Skip to content

Commit

Permalink
Clean up pylint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
tqa236 committed Feb 18, 2024
1 parent eee07dd commit b3508fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
exclude: ^pandas/tests
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
- id: ruff
args: [--exit-non-zero-on-fix, --preview, "--ignore=E,F841,RUF"]
args: [--exit-non-zero-on-fix, --preview, --config, "lint.select=['PL']"]
- id: ruff-format
exclude: ^scripts
- repo: https://github.com/jendrikseipp/vulture
Expand Down
59 changes: 14 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,8 @@ ignore = [
"B023",
# Only works with python >=3.10
"B905",
# Too many arguments to function call
"PLR0913",
# Too many returns
"PLR0911",
# Too many branches
"PLR0912",
# Too many statements
"PLR0915",
# Redefined loop name
"PLW2901",
# Global statements are discouraged
"PLW0603",
# Use `typing.NamedTuple` instead of `collections.namedtuple`
"PYI024",
# No builtin `eval()` allowed
Expand Down Expand Up @@ -318,47 +308,26 @@ ignore = [
"RUF007",
# mutable-class-default
"RUF012",
# Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
# "E721",
# Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
"RUF021",
# `__all__` is not sorted
"RUF022",
# Use a `set` literal when testing for membership
"PLR6201",

# Additional pylint rules
# literal-membership
"PLR6201", # 847 errors
# Method could be a function, class method, or static method
"PLR6301",
"PLR6301", # 11411 errors
# Too many positional arguments (6/5)
"PLR0917",
# `import` should be at the top-level of a file
"PLC0415",
# Too many public methods (23 > 20)
"PLR0904",
# Too many local variables
"PLR0914",
# Too many nested blocks (6 > 5)
"PLR1702",
# Too many Boolean expressions
"PLR0916",
"PLR0917", # 470 errors
# Private name import
"PLC2701",
# Redefining argument with the local name
"PLR1704",
# Unnecessary dunder call
"PLC2801",
# Lambda may be unnecessary; consider inlining inner function
# Autofix might not be correct
"PLW0108",
"PLC2701", # 27 errors
# Object does not implement `__hash__` method
"PLW1641",
"PLW1641", # 16 errors
# `tempfile.NamedTemporaryFile` in text mode without explicit `encoding` argument
"PLW1514",
"PLW1514", # 1 error
# Bad or misspelled dunder method name
"PLW3201",
"PLW3201", # 69 errors, seems to be all false positive
# Unnecessary lookup of dictionary value by key
"PLR1733",
"PLR1733", # 5 errors, it seems like we wannt to ignore these
# Unnecessary lookup of list item by index
"PLR1736",
"PLR1736", # 4 errors, we're currently having inline pylint ignore

# Output of pylint-to-ruff
# "PLC0103", # invalid-name
Expand All @@ -374,7 +343,7 @@ ignore = [
# "PLC0411", # wrong-import-order
# "PLC0412", # ungrouped-imports
# "PLC0413", # wrong-import-position
# "PLC0415", # import-outside-toplevel
"PLC0415", # import-outside-toplevel
# "PLC1802", # use-implicit-booleaness-not-len
# "PLC1803", # use-implicit-booleaness-not-comparison
# "PLC1804", # use-implicit-booleaness-not-comparison-to-string
Expand Down Expand Up @@ -430,7 +399,7 @@ ignore = [
# "PLW0102", # dangerous-default-value
# "PLW0104", # pointless-statement
# "PLW0106", # expression-not-assigned
"PLW0108", # unnecessary-lambda
"PLW0108", # unnecessary-lambda # # Autofix might not be correct
# "PLW0123", # eval-used
# "PLW0125", # using-constant-test
# "PLW0143", # comparison-with-callable
Expand Down

0 comments on commit b3508fd

Please sign in to comment.