Skip to content

Commit 163993a

Browse files
committed
add pre-commit
1 parent a3ea93f commit 163993a

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
- name: Install ruff
19+
run: pip install ruff
20+
- name: Get pre-commit
21+
uses: pre-commit/action@v3.0.0
22+
- name: Run pre-commit
23+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-json
6+
- id: check-yaml
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.11.4
11+
hooks:
12+
- id: ruff
13+
- id: ruff-format

0 commit comments

Comments
 (0)