-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
104 lines (93 loc) · 2.86 KB
/
.pre-commit-config.yaml
File metadata and controls
104 lines (93 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
repos:
# File and format checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=1000'] # Limit files to 1MB
- id: debug-statements
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-case-conflict
- id: mixed-line-ending
- id: check-docstring-first
- id: check-builtin-literals
# Python import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
# Python code formatting
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
language_version: python3
# Python linting (ruff)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: ruff-check
args: ["--fix"]
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies: [types-requests, types-setuptools, types-python-dateutil]
args: [--ignore-missing-imports, --no-strict-optional]
# Security scanning (disabled - dependency issues in pre-commit environment)
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.5
# hooks:
# - id: bandit
# args: ['-r', 'src', '--exclude', 'tests']
# additional_dependencies: ['pbr']
# Dependency vulnerability scanning (disabled - requires authentication)
# - repo: local
# hooks:
# - id: safety-scan
# name: safety scan
# entry: safety
# args: [scan, --json]
# language: system
# pass_filenames: false
# files: requirements.*\.txt$
# Secrets detection
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
# Docker linting
- repo: https://github.com/hadolint/hadolint
rev: v2.14.0
hooks:
- id: hadolint-docker
# Markdown linting (disabled - requires npm package installation)
# - repo: https://github.com/igorshubovych/markdownlint-cli
# rev: v0.38.0
# hooks:
# - id: markdownlint
# args: [--fix]
# YAML formatting and linting
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
hooks:
- id: yamllint
args: [-d, relaxed]
# Commit message format validation
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.0.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [feat, fix, docs, style, refactor, test, chore, perf, ci, build]