Skip to content

Commit 7a6cf19

Browse files
committed
chore: Add pre-commit configuration for Black code formatting
- Create .pre-commit-config.yaml to set up Black formatter - Add pyproject.toml with Black configuration settings - Implement GitHub Actions workflow for pre-commit checks
1 parent 36b5a88 commit 7a6cf19

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Pre-commit Black Check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
pre-commit:
13+
name: Run Pre-commit Hooks
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.x"
24+
25+
- name: Install pre-commit
26+
run: pip install pre-commit
27+
28+
- name: Run pre-commit
29+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 25.1.0
4+
hooks:
5+
- id: black

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[tool.black]
2+
line-length = 88
3+
target-version = ['py311']
4+
include = '\.pyi?$'
5+
exclude = '''
6+
(
7+
/(
8+
\.git
9+
| \.venv
10+
| build
11+
| dist
12+
)/
13+
)
14+
'''

0 commit comments

Comments
 (0)