Add some extra rules to ruff, also add a more complete ruff config that fails

Over time we can enable more rules for `ruff check`
This commit is contained in:
Julian Stirling 2025-04-11 11:56:55 +01:00
parent 5ab0a62964
commit e4cfcc76a7
3 changed files with 83 additions and 2 deletions

View file

@ -78,3 +78,37 @@ addopts = [
[tool.ruff.format]
# Use native line endings for all files
line-ending = "native"
[tool.ruff.lint]
# Slowly add linting rules from ruff-increased-checking.toml commented
# out rules can be checked by running
# ruff --config ruff-increased-checking.toml check
select = [
"E", # pycodestyle errors
"W", #pycodestyle warnings
"F", # PyFlakes
# "PL", # Pylint (a subset of, catches far less than pylint does)
# "B", # Flake8 bugbear
"A", # Flake8 builtins checker
# "C", # Flake8 comprehensions
# "FIX", #TODO/FIXME's in code. These should be added during develoment for ongoing tasks.
# If they are not fixed before merge they should be converted to GitLab issues
# "LOG", # Flake8 logging issues (pedantic logger formatting issues can be added with "G")
# "T20", # Warns for print statments, production code should log
# "PT", # pytest linting
# "RET", # Consistent clear return statments
"RSE", # Raise parentheses
# "SIM", # Simplifications detected
# "ARG", # unused arguments
# "C90", # McCabe complexity!
"NPY", # Numpy linting
"N", # PEP8 naming
# "DOC", # Enforce argument, return, and raise to be mentioned in docstrings there is
# also "D" but this even warns about docstring punctuation. Perhaps a step too
# far?
]
ignore = [
"E501" # Ignore long lines for now
]