Skip to content

Commit 4893898

Browse files
Add ruff to the testing (#421)
https://docs.astral.sh/ruff https://docs.astral.sh/ruff/linter As suggested in #420. Co-authored-by: Aiden Grossman <[email protected]>
1 parent 1851281 commit 4893898

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ jobs:
4343
strategy:
4444
matrix:
4545
python-version: ${{ fromJSON(needs.Envvars.outputs.version_matrix) }}
46-
task: [Typecheck, Lint, Yapf, Test]
46+
task: [Typecheck, Lint, Ruff, Yapf, Test]
4747
include:
4848
- task: Typecheck
4949
cmd: pytype -j auto .
5050
- task: Lint
5151
cmd: pylint --rcfile .pylintrc --recursive yes .
52+
- task: Ruff
53+
cmd: ruff check
5254
- task: Yapf
5355
cmd: yapf . -drp
5456
- task: Test

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ pylint = "==3.3.2"
1616
pytest = "==8.3.4"
1717
pytype = "==2024.10.11"
1818
yapf = "==0.43.0"
19+
ruff = "==0.9.3"
1920

2021
[ci]
2122
joblib = "==1.4.2"
2223
shap = "==0.46.0"
23-

Pipfile.lock

Lines changed: 26 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# DO always create a tracking issue when allow-listing warnings
2-
# DO NOT disable warnings-as-error: warnings of today are tomorrow's evolvability blocker.
1+
[tool.ruff]
2+
line-length = 103
3+
lint.select = [ "C40", "C9", "E", "F", "PERF", "W" ]
4+
lint.ignore = [ "E722", "E731", "E741", "F401", "PERF203" ]
5+
lint.mccabe.max-complexity = 18
36

47
[tool.pytest.ini_options]
8+
# DO always create a tracking issue when allow-listing warnings
9+
# DO NOT disable warnings-as-error: warnings of today are tomorrow's evolvability blocker.
510
filterwarnings = [
611
# Treat warnings as errors
712
"error",

0 commit comments

Comments
 (0)