Skip to content

Commit

Permalink
ci: pin ruff and ignore E302 in Github action (#1974)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyxu authored Feb 18, 2024
1 parent a4b39cb commit 0512bba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
workspaces: python
- name: Install linting tools
run: |
pip install ruff maturin tensorflow tqdm
pip install ruff==0.2.2 maturin tensorflow tqdm
pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Lint Python
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.2.2
hooks:
- id: ruff
args: [--preview, --fix, --exit-non-zero-on-fix]
Expand Down
4 changes: 4 additions & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ tests = [
"tensorflow; python_version<'3.12'", # TODO: remove when tensorflow supports 3.12
"tqdm",
]
dev = ["ruff==0.2.2"]
benchmarks = ["pytest-benchmark"]
torch = ["torch"]

[tool.ruff]
lint.select = ["F", "E", "W", "I", "G", "TCH", "PERF", "CPY001", "B019"]

[tool.ruff.lint.per-file-ignores]
"*.pyi" = ["E302"]

[tool.mypy]
python_version = "3.11"
check_untyped_defs = true
Expand Down

0 comments on commit 0512bba

Please sign in to comment.