Skip to content

Commit

Permalink
Remove blanket ignore of C901 rule and add exception in recognised …
Browse files Browse the repository at this point in the history
…place only
  • Loading branch information
A-Ashiq committed Feb 27, 2025
1 parent 20022a4 commit 5dce400
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ lint.ignore = [
"PLR0913", # Too many arguments - temporarily ignored whilst dev work underway to pass config objects
# into components which have numerous dependencies during initialization
"PLR0911", # Too many return statements
"C901", # Considers function to be too complex, due to switch case statements
"E501", # Ignore line-length in template for populating CMS menu snippet
]

Expand Down Expand Up @@ -94,25 +93,26 @@ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py312"

[tool.ruff.lint.per-file-ignores]
"**/{tests}/*" = [
"E501", # Ignore line length in test files
"S101", # Ignore use of `assert` statement in tests
"SLF001" # Ignore access of private methods/attributes in tests
]
"metrics/api/views/*" = ["E501"] # Ignore line length in API views.
# This infringement is due to
# swagger-facing docstrings/documentation
"metrics/api/views/charts.py" = ["SIM115"] # Ignore context handler for opening file
"**/help_texts.py" = ["W291"] # Ignore trailing whitespace for help texts
"**/build_cms_site.py" = ["W605"] # Ignore escape sequences used in regex calls
"ingestion/file_ingestion.py" = ["BLE001"] # Ignore blind exception catch for file ingestion function
"public_api/views/root_view.py" = ["A002"] # Ignore built-in `format` used in arg to extended
"public_api/version_02/views/root_view.py" = ["A002"] # Ignore built-in `format` used in arg to extended
# rest framework API view method
"caching/public_api/crawler.py" = ["PERF401"] # Ignore list comprehension which would reduce readibility
"caching/common/geographies_crawler.py" = ["PLW1641"] # Ignore requirement of `__hash__` implementation
"metrics/domain/weather_health_alerts/text_lookups/*" = ["W291"] # Ignore trailing whitespace for weather alert text lookups
"config.py" = ["PLW1508"] # Ignore enforcing strings for environment variables
"**/{tests}/*" = [
"E501", # Ignore line length in test files
"S101", # Ignore use of `assert` statement in tests
"SLF001" # Ignore access of private methods/attributes in tests
]
"metrics/api/views/*" = ["E501"] # Ignore line length in API views.
# This infringement is due to
# swagger-facing docstrings/documentation
"metrics/api/views/charts.py" = ["SIM115"] # Ignore context handler for opening file
"**/help_texts.py" = ["W291"] # Ignore trailing whitespace for help texts
"**/build_cms_site.py" = ["W605"] # Ignore escape sequences used in regex calls
"ingestion/file_ingestion.py" = ["BLE001"] # Ignore blind exception catch for file ingestion function
"ingestion/data_transfer_models/validation/geography_code.py" = ["C901"] # Ignore complexity assessment - due to switch case
"public_api/views/root_view.py" = ["A002"] # Ignore built-in `format` used in arg to extended
"public_api/version_02/views/root_view.py" = ["A002"] # Ignore built-in `format` used in arg to extended
# rest framework API view method
"caching/public_api/crawler.py" = ["PERF401"] # Ignore list comprehension which would reduce readibility
"caching/common/geographies_crawler.py" = ["PLW1641"] # Ignore requirement of `__hash__` implementation
"metrics/domain/weather_health_alerts/text_lookups/*" = ["W291"] # Ignore trailing whitespace for weather alert text lookups
"config.py" = ["PLW1508"] # Ignore enforcing strings for environment variables

[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
Expand Down

0 comments on commit 5dce400

Please sign in to comment.