Skip to content

Commit

Permalink
Start enforcing ruff rules
Browse files Browse the repository at this point in the history
Replace flake8 with ruff.
  • Loading branch information
DimitriPapadopoulos committed Jan 27, 2025
1 parent f74d13c commit 88ec4c1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
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
2 changes: 0 additions & 2 deletions pyedflib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# flake8: noqa

# Copyright (c) 2019 - 2020 Simon Kern
# Copyright (c) 2015 - 2020 Holger Nahrstaedt
# Copyright (c) 2016-2017 The pyedflib Developers
Expand Down
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,31 @@ requires = [
"cython"
]
build-backend = "setuptools.build_meta"

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

[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie
"FLY", # flynt
"PERF", # Perflint
"RUF", # Ruff-specific rules
]
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
"ISC002", # Implicitly concatenated string literals over multiple lines
"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", "F403"]
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 88ec4c1

Please sign in to comment.