Skip to content

Commit af3ecfa

Browse files
authored
Add pre-commit (#10)
* Add pre-commit * Create pre-commit.yml
1 parent 344713b commit af3ecfa

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://pre-commit.com
2+
# https://github.com/pre-commit/action
3+
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
4+
# Using pre-commit.ci is even better that using GitHub Actions for pre-commit.
5+
name: pre-commit
6+
on:
7+
pull_request:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
jobs:
12+
pre-commit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.x
19+
- uses: pre-commit/action@v3.0.1

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Learn more about this config here: https://pre-commit.com/
2+
3+
# To enable these pre-commit hooks run:
4+
# `pipx install pre-commit` or `brew install pre-commit`
5+
# Then in the project root directory run `pre-commit install`
6+
7+
repos:
8+
- repo: https://github.com/codespell-project/codespell
9+
rev: v2.4.1
10+
hooks:
11+
- id: codespell
12+
args:
13+
- --ignore-words-list=alse,ons
14+
additional_dependencies:
15+
- tomli
16+
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.11.2
19+
hooks:
20+
- id: ruff
21+
- id: ruff-format
22+
23+
- repo: https://github.com/pycqa/flake8
24+
rev: 7.1.2
25+
hooks:
26+
- id: flake8
27+
28+
- repo: https://github.com/tox-dev/pyproject-fmt
29+
rev: v2.5.1
30+
hooks:
31+
- id: pyproject-fmt
32+
33+
- repo: https://github.com/abravalheri/validate-pyproject
34+
rev: v0.24.1
35+
hooks:
36+
- id: validate-pyproject

0 commit comments

Comments
 (0)