-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
131 lines (131 loc) Β· 5.39 KB
/
.pre-commit-config.yaml
File metadata and controls
131 lines (131 loc) Β· 5.39 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
120
121
122
123
124
125
126
127
128
129
130
131
# https://pre-commit.com/#installation
default_stages: [pre-commit, pre-push]
default_language_version:
python: python3
node: 24.11.1
minimum_pre_commit_version: '3.2.0'
repos:
- repo: meta
hooks:
- id: identity
name: Run identity
description: Run the identity check
- id: check-hooks-apply
name: Check hooks apply to the repository
description: Useful when testing new hooks to see if they apply to the repository
- repo: local
hooks:
- id: prettier
name: run prettier
description: format files with prettier
entry: prettier --write '**/*.html' '**/*.js' '**/*.json' '**/*.md' '**/*.yaml' '**/*.yml'
files: \.(html|json|md|ya?ml)$
language: node
additional_dependencies: ['prettier@3.7.4']
- id: check-zip-file-is-not-committed
name: Zip files are not allowed in the repository
description: Zip files are not allowed in the repository
language: fail
entry: |
Zip files are not allowed in the repository as they are hard to
track and have security implications. Please remove the zip file from the repository.
files: \.zip$
- repo: https://github.com/pycqa/isort
rev: 7.0.0
hooks:
- id: isort
name: run isort
description: A Python utility / library to sort imports.
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
name: The uncompromising Python code formatter
description: Black is the uncompromising Python code formatter.
types: [python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-case-conflict
description: Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-illegal-windows-names
description: Check for files that cannot be created on Windows.
- id: check-json
description: Attempts to load all json files to verify syntax.
- id: check-merge-conflict
description: Check for files that contain merge conflict strings.
- id: check-toml
description: Attempts to load all TOML files to verify syntax.
- id: check-vcs-permalinks
description: Ensures that links to vcs websites are permalinks.
- id: check-yaml
description: Attempts to load all yaml files to verify syntax.
- id: detect-aws-credentials
description: Checks for the existence of AWS secrets that you have set up with the AWS CLI.
args: [--allow-missing-credentials]
- id: detect-private-key
description: Checks for the existence of private keys.
- id: end-of-file-fixer
description: Makes sure files end in a newline and only a newline.
- id: fix-byte-order-marker
description: Removes UTF-8 byte order marker.
- id: forbid-submodules
description: Forbids any submodules in the repository.
- id: mixed-line-ending
description: Replaces or checks mixed line ending.
- id: trailing-whitespace
description: Trims trailing whitespace.
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: chmod
name: Set file permissions
description: Does not run on Windows so setup as a manual hook
args: ['644']
files: \.md$
stages: [manual]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-mock-methods
name: run check for not-real mock methods
description: Prevent common mistakes of assert mck.not_called(), assert mck.called_once_with(...) and mck.assert_called
- id: python-no-eval
name: run check for eval()
description: A quick check for the eval() built-in function
- id: python-no-log-warn
name: run check for use logger.warning(
description: A quick check for the deprecated .warn() method of python loggers
- id: python-use-type-annotations
name: run check for type annotations not comments
description: Enforce that python3.6+ type annotations are used instead of type comments
- id: rst-backticks
name: run rst-backticks
description: detect common mistake of using single backticks when writing rst
- id: rst-directive-colons
name: run rst-directive-colons
description: detect mistake of rst directive not ending with double colon or space before the double colon
- id: rst-inline-touching-normal
name: run rst-inline-touching-normal
description: detect mistake of inline code touching normal text in rst
- id: text-unicode-replacement-char
name: run check for no unicode replacement char
description: Forbid files which have a UTF-8 Unicode replacement character
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.45.0
hooks:
- id: markdownlint
name: run markdownlint
description: checks the style of Markdown files
args: [--config=.github/linters/.markdown-lint.yml]
types: [markdown]
files: \.md$
- repo: https://github.com/adrienverge/yamllint
rev: v1.37.1
hooks:
- id: yamllint
name: run yamllint
description: check YAML files with yamllint
args: [--strict, -c=.github/linters/.yaml-lint.yml]
types: [yaml]
files: \.ya?ml$