Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit checks #517

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,46 @@ ci:

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v2.31.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this highlights the need to upgrade the version in the repo where you've taken this code from as it's old.

Suggested change
rev: v2.31.0
rev: v3.15.0

hooks:
- id: pyupgrade
args: ["--py37-plus"]
args: ["--py39-plus"]

- repo: https://github.com/adamchainz/django-upgrade
rev: '1.15.0'
rev: '1.4.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep an eye out for these, and if the version is lower on one repo, update it so that we are using the later versions everywhere. So what I'm seeing here makes it look like the pre-commit file in django-cms may need it's version upgrading.

Suggested change
rev: '1.4.0'
rev: '1.15.0'

hooks:
- id: django-upgrade
args: [--target-version, "2.2"]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: [--target-version, "3.2"]

- repo: https://github.com/asottile/yesqa
rev: v1.5.0
rev: v1.3.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev: v1.3.0
rev: v1.5.0

hooks:
- id: yesqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev: v4.1.0
rev: v4.5.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm making these modify and upgrading also codespell and ruff-pre-commit

hooks:
- id: check-merge-conflict
- id: debug-statements
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pycqa/isort
rev: 5.13.2
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.0
hooks:
- id: isort
- id: rstcheck
additional_dependencies:
- sphinx==6.1.3
- tomli==2.0.1
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.ruff]
select=[
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"PLE", # pylint error
"PLR", # pylint refactor
"PLW", # pylint warning
"UP", # pyupgrade
]

extend-ignore = [
# TODO fix separately
"E501", # line too long
"I001", # import block unsorted
"C408", # unnecessary dict call
]
Loading