Skip to content

Commit bc305fb

Browse files
committed
chore: add pre-commit configuration and CI
1 parent de68bb5 commit bc305fb

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/linter.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.x'
17+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
args: [--unsafe]
11+
- id: check-json
12+
- id: check-added-large-files
13+
- id: check-shebang-scripts-are-executable
14+
- id: check-executables-have-shebangs
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.14.13
17+
hooks:
18+
- id: ruff
19+
args: [--fix, --exit-non-zero-on-fix, --ignore, "D,E501"]
20+
- id: ruff-format
21+
- repo: https://github.com/pre-commit/mirrors-prettier
22+
rev: v4.0.0-alpha.8
23+
hooks:
24+
- id: prettier
25+
files: \.(md|yaml|yml|json)$
26+
- repo: https://github.com/koalaman/shellcheck-precommit
27+
rev: v0.10.0
28+
hooks:
29+
- id: shellcheck
30+
- repo: https://github.com/codespell-project/codespell
31+
rev: v2.4.1
32+
hooks:
33+
- id: codespell

0 commit comments

Comments
 (0)