Skip to content

Commit 42941e7

Browse files
feat: add pre-commit hooks and repository setup documentation
1 parent 2d172de commit 42941e7

File tree

19 files changed

+860
-0
lines changed

19 files changed

+860
-0
lines changed

.pre-commit-config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Pre-commit hooks configuration
2+
# Install: pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
5+
repos:
6+
# General file checks
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.5.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-yaml
13+
- id: check-added-large-files
14+
args: ['--maxkb=1000']
15+
- id: check-json
16+
- id: check-toml
17+
- id: check-merge-conflict
18+
- id: detect-private-key
19+
- id: mixed-line-ending
20+
21+
# Python code formatting
22+
- repo: https://github.com/psf/black
23+
rev: 23.12.1
24+
hooks:
25+
- id: black
26+
language_version: python3.11
27+
args: ['--line-length=100']
28+
29+
# Import sorting
30+
- repo: https://github.com/pycqa/isort
31+
rev: 5.13.2
32+
hooks:
33+
- id: isort
34+
args: ['--profile', 'black', '--line-length', '100']
35+
36+
# Linting
37+
- repo: https://github.com/pycqa/flake8
38+
rev: 7.0.0
39+
hooks:
40+
- id: flake8
41+
args: ['--max-line-length=100', '--extend-ignore=E203,W503']
42+
43+
# Security checks
44+
- repo: https://github.com/PyCQA/bandit
45+
rev: 1.7.6
46+
hooks:
47+
- id: bandit
48+
args: ['-r', 'src/', '-ll']
49+
exclude: tests/

0 commit comments

Comments
 (0)