Skip to content

Commit

Permalink
Use ruff to prevent various regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Mar 25, 2024
1 parent 493aba1 commit 170d2ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
- run: pip install isort pycln
- run: pycln . --config=pycln.toml --check
- run: isort . --diff --check-only
- uses: chartboost/ruff-action@v1
with:
version: '0.3.4'
- uses: psf/black@stable
with:
options: "--fast --check --diff --verbose"
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ repos:
- id: isort
name: isort (python)
verbose: true
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff # Run the linter.
args: [--fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.2.0
hooks:
Expand Down
16 changes: 16 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Target the oldest supported version
target-version = "py37"

[lint]
select = [
"C4", # flake8-comprehensions
"F811", # redefined-while-unused
"FLY", # static-join-to-f-string
"PLE", # Pylint Error
"RSE", # flake8-raise
"YTT", # flake8-2020
]

[lint.per-file-ignores]
# TODO: Make adodbapi changes in their own PRs
"adodbapi/*" = ["C4", "YTT301"]

0 comments on commit 170d2ab

Please sign in to comment.