Skip to content

Commit

Permalink
Add ruff to the testing (#421)
Browse files Browse the repository at this point in the history
https://docs.astral.sh/ruff
https://docs.astral.sh/ruff/linter

As suggested in #420.

Co-authored-by: Aiden Grossman <aidengrossman@google.com>
  • Loading branch information
cclauss and boomanaiden154 authored Jan 29, 2025
1 parent 1851281 commit 4893898
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ jobs:
strategy:
matrix:
python-version: ${{ fromJSON(needs.Envvars.outputs.version_matrix) }}
task: [Typecheck, Lint, Yapf, Test]
task: [Typecheck, Lint, Ruff, Yapf, Test]
include:
- task: Typecheck
cmd: pytype -j auto .
- task: Lint
cmd: pylint --rcfile .pylintrc --recursive yes .
- task: Ruff
cmd: ruff check
- task: Yapf
cmd: yapf . -drp
- task: Test
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pylint = "==3.3.2"
pytest = "==8.3.4"
pytype = "==2024.10.11"
yapf = "==0.43.0"
ruff = "==0.9.3"

[ci]
joblib = "==1.4.2"
shap = "==0.46.0"

28 changes: 26 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

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

0 comments on commit 4893898

Please sign in to comment.