Skip to content

Commit

Permalink
Ensure Ruff checks formatting during CI checks (#2021)
Browse files Browse the repository at this point in the history
* Ensure make test runs ruff format --check

* Update ruff extension cfg

- The VSCode ruff extension will no longer automatically remove unused imports but will still notify you they're incorrect
- Updated ruff to 0.8.2
  • Loading branch information
whabanks authored Dec 13, 2024
1 parent 3a5482a commit 7863163
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
13 changes: 5 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@
"vsliveshare.vsliveshare"
],
"settings": {
"ruff.lint.ignore": ["F401"],
"ruff.lint.run": "onSave",
"ruff.organizeImports": false,
"[python]": {
"ruff.lint.run": "onSave",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
},
"ruff.configurationPreference": "filesystemFirst"
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ run-gunicorn:

.PHONY: format
format:
ruff check --select I --fix .
ruff check --fix .
ruff check
ruff format .
mypy ./
Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ mypy = "1.11.2"
monkeytype = "23.3.0"
poethepoet = "^0.24.4"
pre-commit = "^3.7.1"
ruff = "^0.6.9"
ruff = "^0.8.2"

# stubs libraries to keep mypy happy
types-python-dateutil = "2.9.0.20241003"
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ display_result $? 1 "Code style check"
ruff check --select I .
display_result $? 1 "Import order check"

ruff format --check .
display_result $? 1 "Code format check"

mypy ./
display_result $? 1 "Type check"

Expand Down

0 comments on commit 7863163

Please sign in to comment.