-
-
Notifications
You must be signed in to change notification settings - Fork 547
Replace linters with ruff #3145
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
Changes from 2 commits
987765d
2370718
ccb5867
ea34039
43d300c
4ed991e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,46 @@ | ||
| [tool.black] | ||
| exclude = ''' | ||
| /( | ||
| venv | ||
| | frontend | ||
| | node_modules | ||
| )/ | ||
| ''' | ||
| [tool.isort] | ||
| [tool.ruff] | ||
| line-length = 140 | ||
| target-version = "py311" | ||
|
|
||
| exclude = [ | ||
| "venv", | ||
| "frontend", | ||
| "node_modules", | ||
| "migrations", | ||
| "docs", | ||
| "virtualenv", | ||
| "configuration/ldap_config.py", | ||
| ] | ||
|
|
||
| [tool.ruff.lint] | ||
| select = [ | ||
| "E", # pycodestyle errors | ||
| "W", # pycodestyle warnings | ||
| "F", # pyflakes | ||
| "I", # isort | ||
| "N", # pep8-naming | ||
| "UP", # pyupgrade | ||
| "B", # flake8-bugbear | ||
| "C4", # flake8-comprehensions | ||
| "DJ", # flake8-django | ||
| ] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this specific set has been chosen over all the possibilities?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The selected ruleset is intentionally conservative and maps closely to the linters we were already using (flake8 core, flake8-django, isort), with a few widely adopted extensions like bugbear and comprehensions that catch real issues with low noise Core Rules (Direct Replacements)
|
||
|
|
||
| ignore = [ | ||
| "W503", # line break before binary operator (conflicts with black) | ||
| "E231", # missing whitespace after ',' | ||
| "W605", # invalid escape sequence | ||
| ] | ||
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| "__init__.py" = ["F401"] # unused imports in __init__ files | ||
|
|
||
| [tool.ruff.lint.isort] | ||
| known-first-party = ["certego_saas"] | ||
| profile = "black" | ||
| multi_line_output = 3 | ||
| use_parentheses = true | ||
| known_first_party = ["certego_saas"] | ||
|
|
||
| [tool.ruff.format] | ||
| quote-style = "double" | ||
| indent-style = "space" | ||
|
|
||
| [tool.codereviewdoctor] | ||
| disable = ["missing-reverse-migration"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| flake8==7.1.1 | ||
| black==24.10.0 | ||
| isort==5.12.0 | ||
| ruff==0.8.6 | ||
|
||
| pre-commit==4.0.1 | ||
| coverage==7.6.1 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason to use an old version ?