-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
100 lines (93 loc) · 3.36 KB
/
.pre-commit-config.yaml
File metadata and controls
100 lines (93 loc) · 3.36 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
# Pre-commit configuration for URST Python
# See https://pre-commit.com for more information
repos:
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
# Run the linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
# MyPy for static type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies: [types-all]
args: [--strict, --ignore-missing-imports]
# General code quality hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# Check for files that contain merge conflict strings
- id: check-merge-conflict
# Check for debugger imports and py37+ `breakpoint()` calls
- id: debug-statements
# Check for the existence of AWS credentials
- id: detect-aws-credentials
args: [--allow-missing-credentials]
# Check for the existence of private keys
- id: detect-private-key
# Check whether files parse as valid python
- id: check-ast
# Check for byte-order marker
- id: check-byte-order-marker
# Require literal syntax when initializing empty or zero Python builtin types
- id: check-builtin-literals
# Check for files with names that would conflict on a case-insensitive filesystem
- id: check-case-conflict
# Check docstring is first
- id: check-docstring-first
# Check that executables have shebangs
- id: check-executables-have-shebangs
# Check JSON files for parseable syntax
- id: check-json
# Check for files that contain merge conflict strings
- id: check-merge-conflict
# Check for symlinks which are changed from the repository to a file
- id: check-symlinks
# Check for files that would conflict in case-insensitive filesystems
- id: check-toml
# Check for valid XML files
- id: check-xml
# Check YAML files for parseable syntax
- id: check-yaml
# Check for files with names that would conflict on a case-insensitive filesystem
- id: end-of-file-fixer
# Check for files that don't end in a newline
- id: fix-byte-order-marker
# Remove UTF-8 byte order marker
- id: mixed-line-ending
# Replaces or checks mixed line endings
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
# Security scanning with bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ['bandit[toml]']
exclude: ^tests/
# Check for common security issues
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
# Configuration for pre-commit.ci (if using)
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com 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