Skip to content

Commit dbb0069

Browse files
committed
Lint with Ruff via pre-commit on GitHub Actions
1 parent 48f48b1 commit dbb0069

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

.github/workflows/lint.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions: {}
6+
7+
env:
8+
FORCE_COLOR: 1
9+
RUFF_OUTPUT_FORMAT: github
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.x"
22+
- uses: tox-dev/action-pre-commit-uv@v1

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.11.3
4+
hooks:
5+
- id: ruff
6+
args: [--exit-non-zero-on-fix]

.ruff.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fix = true
2+
extend-exclude = [
3+
"*.cgi", # Python 2 code
4+
]
5+
target-version = "py310"
6+
7+
lint.select = [
8+
"W605", # invalid-escape-sequence
9+
]

0 commit comments

Comments
 (0)