Skip to content

Commit a269daa

Browse files
committed
pre-commit: initialize (Infra)
1 parent 1440fc9 commit a269daa

3 files changed

Lines changed: 54 additions & 20 deletions

File tree

.github/workflows/black.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/pre-commit.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PreCommit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- release/[0-9]+.[0-9]+
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
PreCommit:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- uses: actions/setup-python@v6
20+
with:
21+
python-version: 3.x
22+
- uses: pre-commit/action@v3.0.1
23+
- uses: pre-commit-ci/lite-action@v1.1.0
24+
if: always()
25+
with:
26+
msg: "pre-commit: apply automatic fixes"

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
exclude: ^vendor
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-added-large-files
10+
- repo: https://github.com/psf/black
11+
rev: c6755bb741b6481d6b3d3bb563c83fa060db96c9 # frozen: 26.3.1
12+
hooks:
13+
- id: black
14+
args: [--line-length=79]
15+
- repo: https://github.com/PyCQA/autoflake
16+
rev: 2d3853a9f31d97783fb2e181d41cd82a6babd666 # frozen: v2.3.3
17+
hooks:
18+
- id: autoflake
19+
- repo: https://github.com/PyCQA/flake8
20+
rev: d93590f5be797aabb60e3b09f2f52dddb02f349f # frozen: 7.3.0
21+
hooks:
22+
- id: flake8
23+
args: [--max-line-length=79]
24+
- repo: https://github.com/PyCQA/isort
25+
rev: a333737ed43df02b18e6c95477ea1b285b3de15a # frozen: 8.0.1
26+
hooks:
27+
- id: isort
28+
args: [-l, "79", --profile, black]

0 commit comments

Comments
 (0)