-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
81 lines (72 loc) · 2.24 KB
/
.pre-commit-config.yaml
File metadata and controls
81 lines (72 loc) · 2.24 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
# Pre-commit hooks configuration
# Install: pre-commit install
# Run manually: pre-commit run --all-files
repos:
# Ruff - Fast Python linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.12
hooks:
# Run the linter
- id: ruff-check
types_or: [python, pyi]
# Run the formatter
- id: ruff-format
types_or: [python, pyi]
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
# Prevent committing large files
- id: check-added-large-files
args: ['--maxkb=1000']
# Check for merge conflict markers
- id: check-merge-conflict
# Check YAML syntax
- id: check-yaml
args: ['--unsafe'] # Allow custom YAML tags in k8s files
# Check TOML syntax
- id: check-toml
# Ensure files end with newline
- id: end-of-file-fixer
# Remove trailing whitespace
- id: trailing-whitespace
# Check for files that would conflict on case-insensitive filesystems
- id: check-case-conflict
# Prevent committing directly to main/master
- id: no-commit-to-branch
args: ['--branch', 'main', '--branch', 'master']
- id: detect-private-key
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies:
- types-requests
# Removed types-python-dotenv since python-dotenv has inline types
# Security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.9.3
hooks:
- id: bandit
args: ['-c', 'pyproject.toml']
additional_dependencies: ['bandit[toml]']
exclude: ^tests/
# Check for common security issues
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.0
hooks:
- id: check-github-workflows
- id: check-dependabot
- repo: https://github.com/hadolint/hadolint
rev: v2.14.0
hooks:
- id: hadolint-docker
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.3.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# Global settings
default_install_hook_types: [pre-commit, commit-msg]
default_stages: [pre-commit]
fail_fast: false