Skip to content

Commit

Permalink
Start enforcing ruff rules
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Jan 26, 2025
1 parent 0e574af commit d9cd862
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
pip install -e .
pip install -r requirements-test.txt
pytest
pytest --ruff
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,29 @@ requires = [
"cython"
]
build-backend = "setuptools.build_meta"

[tool.ruff]
target-version = "py38"

[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"C4", # flake8-comprehensions
"PIE", # flake8-pie
"FLY", # flynt
"PERF", # Perflint
"RUF",
]
ignore = [
"F841", # Local variable is assigned to but never used
"UP031", # Use format specifiers instead of percent format
"UP032", # Use f-string instead of `format` call
"PERF203", # `try`-`except` within a loop incurs performance overhead
"RUF003",
"RUF005", # Consider iterable unpacking instead of concatenation
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF100", # Unused `noqa` directive
]

[tool.ruff.lint.extend-per-file-ignores]
"**/__init__.py" = ["F401"] # imported but unused
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pip
setuptools
wheel
flake8
nose
coverage
cython
numpy
pytest
pytest-ruff
dateparser
tqdm

0 comments on commit d9cd862

Please sign in to comment.