Skip to content

Commit b186c35

Browse files
committed
add ruff to action and pre-commit
1 parent a6fcb27 commit b186c35

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.github/workflows/black.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,17 @@ jobs:
88
steps:
99
- uses: actions/checkout@v2
1010
- uses: psf/black@stable
11+
12+
# Set up Python (required for installing Ruff)
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.10'
17+
18+
# Install Ruff
19+
- name: Install Ruff
20+
run: pip install ruff
21+
22+
# Run Ruff as a linter (formatting rules disabled)
23+
- name: Run Ruff Linter
24+
run: ruff .

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ repos:
2323
- id: check-yaml
2424
- id: end-of-file-fixer
2525
- id: trailing-whitespace
26+
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.12.1
29+
hooks:
30+
- id: ruff
31+
args: [] # No --fix, disables formatting

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ exclude = ["tests*"]
6262

6363
[tool.setuptools.package-data]
6464
"*" = ["**/*.txt", "**/*.json"]
65+
66+
[tool.ruff]
67+
# Run Ruff as a linter (formatting rules disabled)
68+
exclude = [".venv"]
69+
ignore = ["E501", "W291", "W293", "E302", "E303", "E305"]
70+
line-length = 88 # Match Black's default
71+
target-version = "py310"

0 commit comments

Comments
 (0)