-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
119 lines (105 loc) · 3.26 KB
/
.pre-commit-config.yaml
File metadata and controls
119 lines (105 loc) · 3.26 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Pre-commit hooks for VideoAnnotator
# Install with: pre-commit install
# Exclude tokens directory (contains encrypted blobs / non-JSON-safe data)
exclude: ^tokens/
repos:
# Built-in hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=10000"]
- id: check-json
- id: check-toml
- id: check-xml
- id: check-merge-conflict
- id: debug-statements
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: mixed-line-ending
- id: check-case-conflict
- id: check-docstring-first
- id: check-ast
- id: fix-byte-order-marker
# Python linting and formatting with Ruff (replaces Black, isort, flake8)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Pinned to a known-good stable release for reproducibility.
rev: v0.14.0
hooks:
- id: ruff
args: [--fix]
exclude: ^tests/
- id: ruff-format
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
args: [--config-file=pyproject.toml, --namespace-packages]
additional_dependencies: [types-PyYAML, types-requests]
exclude: ^(src/videoannotator/pipelines/|src/videoannotator/storage/|src/videoannotator/utils/|src/videoannotator/version\.py|src/videoannotator/exporters/|src/videoannotator/schemas/|examples/|scripts/)
# Security scanning
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [-r, src, -f, json]
pass_filenames: false
exclude: tests/
additional_dependencies: [pbr]
stages: [manual]
# Documentation
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: [--convention=google]
files: ^src/api/
stages: [manual]
# YAML formatting
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
files: \.(yaml|yml|json|md)$
stages: [manual]
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
files: ^scripts/
stages: [manual]
# Dockerfile linting
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
args: [--ignore, DL3008, --ignore, DL3009]
# Python dependency security
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.2
hooks:
- id: python-safety-dependencies-check
stages: [manual]
# Git commit message linting
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.7.1
hooks:
- id: commitizen
stages: [commit-msg]
# Note: autoflake functionality now handled by ruff --fix
# Configuration for specific hooks
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
skip: []
submodules: false