Skip to content

Commit

Permalink
Ignore more ruff rules
Browse files Browse the repository at this point in the history
Some can be ignored, some should be fixed but can be ignored for now.
  • Loading branch information
153957 committed Oct 8, 2023
1 parent a5ca264 commit 4de3132
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ extend-exclude = [
'doc/conf.py',
]
ignore = [
'A003', # Model fields shadowing builtins
'ANN', # Requires type annotation
'ARG002', # Unused function arguments
'B904', # Exception causes
'D', # Docstrings
'DJ001', # Do not allow nullable CharField
'DTZ', # Timezone aware datetimes
'EM', # String literals in exceptions
'FBT002', # Allow default boolean positional argument
'FIX', # Using FIXME/TODO/XXX comments
'ICN001', # Common package import alias
'PD', # Not using pandas
'PERF203', # Allow try/except in loop
'PLR0913', # Allow functions with many arguments
'PT', # Requires pytest
'RET', # Logic around return
'RUF012', # Requires type annotation
'S311', # Unsafe random generator for cryptographic purpose
'SIM108', # Requires ternary operator instead of if-else
'SLF001', # Using 'private' members, e.g. _v_name
'TD001', # Allow FIXME
Expand All @@ -28,8 +35,30 @@ ignore = [
'TID252', # Requires absolute imports
'TRY003', # Long messages for common exception classes
'TRY200', # Requires cause for raise in except
'TRY400', # Allow logger.error instead of logger.exception, message is clear and unique
# FIXME: The following should be 'easy' to fix
'A001', # Stop shadowing builtins with variables
'A002', # Stop shadowing builtins with arguments
'ARG001', # Functions with unused arguments
'B905', # Explicit value for strict in zip
'DJ008', # Create __str__ for all models
'PLR0911', # Reduce number of return statements
'PLR0912', # Reduce number of branches in function
'PLR0915', # Reduce number of statements in function
'PLR2004', # Assign 'magic numbers' via constant variables
'PLW2901', # Loop variable overwritten in loop
'PTH', # Should move from os.path to pathlib.Path
'S308', # Check if mark_safe is safe here
'S324', # Consider using different hash method
'TD', # Incorrectly formatted TODO
]

[tool.ruff.per-file-ignores]
'publicdb/settings_develop.py' = ['S105'] # Hard coded SECRET_KEY for development
'publicdb/settings_docker.py' = ['F405'] # Star imports
# FIXME: The following should be fixable
'publicdb/inforecords/models.py' = ['S110', 'BLE001'] # Capture specific exceptions and handle it

[tool.ruff.isort]
lines-between-types = 1
section-order = [
Expand All @@ -48,6 +77,9 @@ django = ['django']
sapphire = ['sapphire']
tests = ['tests']

[tool.ruff.mccabe]
max-complexity = 18

[tool.ruff.flake8-quotes]
inline-quotes = 'single'

Expand Down

0 comments on commit 4de3132

Please sign in to comment.