You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Redefining ruff, starting with target-version = "py38"
Let's remove all rules so far, and re-introduce those by following the
definitions of pylint.
The first rule is target-version infered from the package definition that
requires-python >= 3.8.
* Excluding CSV and ref.*?py
Patterns defined at .python-lint lines 10 & 14.
* Disabling rules according to .python-lint
Current setup defined between lines 57-105.
* max-nested-blocks
Defining `max-nested-blocks` as .pyhton-lint line 141.
* Confirming with expected-line-ending-format
While pylint defines `expected-line-ending-format`, ruff uses
`line-ending` instead. Defined in .python-lint line 254.
* Defining line-lenght as .python-lint line 267
* indent-width
* multiple-statements-on-one-line-colon
Equivalent to single-line-if-stmt at line 278 of .python-lint
* task-tags
In reference to notes, line 291 of .python-lint
* In respect t ologging-modules, line 285 of .python-lint
We don't need that with ruff, but here is a placeholder if we want to
add more than default `logger` in the future.
* unused imports
Addressing "init-import=no" in line 402 from .python-lint
* Defining max-args
Interestingly, max-args is defined as 5 in line 434, but PLR0913 rule is
ignored.
* Defining DESIGN explicit setup
To reflect DESIGN section in .python-lint, pages 431-463.
* Closest option of satisfy EXCEPTIONS
Ruff doesn't implement the exactly the same, but E722 is good enough if
not even better.
* Re-introducing all (W) Warning rules
* Re-introducing (Q) flake8-quotes rules
sup3r do not follow:
- Q000 bad-quotes-inline-string
- Q004 unnecessary-escaped-quote
* Re-introducing (I) isort rules
sup3r do not follow I001: unsorted-imports.
* Re-introducing (NPY) NymPy-specific rules
sup3r doesn't follow NPY002, but we might want to re-consider that in
the future.
* style: Conforming with UP039
* Re-introducing (UP) pyupgrade rules
sup3r doesn't follow:
- UP009: utf8-encoding-declaration
- UP015: redundant-open-modes
- UP032: f-string
* Re-introducing (A) flake8-builtins
sup3r doesn't conform with, but should reconsider that in the future:
- A001: builtin-variable-shadowing
- A002: builtin-argument-shadowing
* Re-introducing (ARG) flake8-unused-arguments rules
sup3r doesn't conform with:
- ARG002: unused-method-argument
- ARG003: unused-class-method-argument
- ARG004: unused-static-method-argument
- ARG005: unused-lambda-argument
* Re-introducing (E) pycodestyle rules
* Re-introducing (F) Pyflakes rules
* Re-introducing (COM) flake8-commas rules
sup3r doesn't conform with:
- COM812: missing-trailing-comma
* Introducing (N) pep8-naming rules
sup3r doesn't conform with:
- N802: invalid-function-name
- N803: invalid-argument-name
- N806: non-lowercase-variable-in-function
* Introducing (D) pydocstyle rules
sup3r doesn't conform with:
- D105: undocumented-magic-method
- D200: fits-on-one-line
- D202: no-blank-line-after-function
- D204: one-blank-line-after-class
- D205: blank-line-after-summary
- D207: under-indentation
- D209: new-line-after-last-paragraph
- D400: ends-in-period
- D401: non-imperative-mood
- D404: docstring-starts-with-this
* Introducing (PL) Pylint rules
sup3r doesn't conform with:
- PLR2004: magic-value-comparison
- PLW2901: redefined-loop-name
* Running ruff with GA
* Nothing is fixable for now
* Using ruff with pre-commmit
* style: Conforming with NPY003 & NPY201
* style: Conforming with COM819
* Forgot to include: quote-style & indent-style
* Updating requirements on ruff
* GA outputs ruff with github style
* Adding (C4) flake8-comprehensions
As suggested by @bnb32
sup3r doesn't conform with:
- C408: unnecessary-collection-call
- C414: unnecessary-double-cast-or-process
* Adding rule (C90) mccabe
As suggested by @bnb32
Using max-complexity as previously defined for flake8
(lintesrs/.flake8) as equal to 12.
* Adding convention (C) and flake8-logging (LOG)
@bnb32 any other rule that you would like to include?
* validate all codebase with super-linter
There were some misterious situations where super-linter was not
properly checking the code. Paul mentioned a setup that limits checks to
the very last commit only. I expect that VALIDATE_ALL_CODEBASE should
address that.
* Adding (SIM) flake8-simplify rules
As suggested by @bnb32.
sup3r doesn't conform with:
- SIM108: if-else-block-instead-of-if-exp
- SIM117: multiple-with-statements
- SIM118: in-dict-keys
- SIM211: if-expr-with-false-true
* Adding (PERF) Perflint rules
As suggested by @bnb32
sup3r doesn't conform with:
- PERF102: incorrect-dict-iterator
- PERF203: try-except-in-loop
- PERF401: manual-list-comprehension
* We don't need to run on the full code base anymore
With the pull_request trigger we don't need VALIDATE_ALL_CODEBASE set to
true anymore. Otherwise it's running twice. Thanks @ppinchuk!
* clean: Removing implicit rules
While conforming with the legacy setup, I added a few explicit specific
rules but in the final version didn't make sense anymore since those
are now implicit. For instance, no need of "E701" is added "E".
0 commit comments