-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
153 lines (132 loc) · 5.29 KB
/
.pre-commit-config.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Apply to all files without committing:
# pre-commit run --all-files
# Update this file:
# pre-commit autoupdate
default_language_version:
# force all unspecified python hooks to run python3
python: python3
# https://pre-commit.ci/
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: monthly
skip:
- eslint # Skip ESLint checks in CI due to missing node environment
- php-lint-all # Skip PHP lint checks in CI due to missing PHP environment
- php-cs # Skip PHP Code Sniffer checks in CI due to missing PHP environment
submodules: false
# Globally exclude files
# https://pre-commit.com/#top_level-exclude
exclude: |
(?x)(
.min(.css|.js)|
.(css|js).map|
languages/|
node_modules/|
vendor/|
assets/css/|
.idea/(.*)
)
# pre-commit setup
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Identify invalid files
- id: check-yaml
name: Check YAML
description: This hook checks that your YAML is parseable.
- id: check-json
name: Check JSON
description: This hook checks that your JSON is parseable.
- id: check-xml
name: Check XML
description: This hook checks that your XML is parseable.
# git checks
- id: check-merge-conflict
name: Check Merge Conflict
description: This hook checks for files that contain merge conflict strings.
- id: check-added-large-files
name: Check Added Large Files
description: This hook checks for large files that have been added to the repository.
args:
- --maxkb=1000
- id: detect-private-key
name: Detect Private Key
description: This hook detects private keys.
- id: check-case-conflict
name: Check Case Conflict
description: This hook checks for files with names that differ only in case.
# General quality checks
- id: mixed-line-ending
name: Mixed Line Ending
description: This hook checks for files that have mixed line endings.
args:
- --fix=lf
- id: trailing-whitespace
name: Trailing Whitespace
description: This hook removes trailing whitespace.
args:
- --markdown-linebreak-ext=md
- id: check-executables-have-shebangs
name: Check Executables Have Shebangs
description: This hook checks that all executable files have a shebang.
- id: end-of-file-fixer
name: End of File Fixer
description: This hook ensures that files end with a newline.
- repo: https://github.com/digitalpulp/pre-commit-php.git
rev: 1.4.0
hooks:
- id: php-lint-all
name: PHP Lint (All)
description: This hook checks for PHP syntax errors in all PHP files.
- id: php-cs
name: PHP Code Sniffer
description: This hook checks for coding standard violations.
files: \.(php)$
args:
- --standard=PSR2,./phpcs.xml
- -p
- repo: https://github.com/eslint/eslint
rev: v8.56.0
hooks:
- id: eslint
name: ESLint
description: This hook checks for problems in JavaScript code.
# additional_dependencies:
# # eslint itself needs to be here when using additional_dependencies.
# - [email protected] # https://github.com/eslint/eslint/releases/latest
# - [email protected] # https://github.com/sindresorhus/globals/releases/latest
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v16.2.1
hooks:
- id: stylelint
name: Stylelint
description: This hook checks for problems in CSS code.
args:
- --formatter=compact
additional_dependencies:
# stylelint itself needs to be here when using additional_dependencies.
- [email protected] # https://github.com/stylelint/stylelint/releases/latest
- [email protected] # https://github.com/stylelint/stylelint-config-standard/releases/latest
- [email protected] # https://github.com/stylelint-scss/stylelint-config-standard-scss/releases/latest
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.3
hooks:
- id: editorconfig-checker
name: EditorConfig Checker
description: This hook checks for compliance with definitions made in EditorConfig files.
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
name: Mdformat
description: This hook checks for Markdown formatting issues.
additional_dependencies: # https://mdformat.readthedocs.io/en/stable/users/plugins.html#code-formatter-plugins
- mdformat-gfm==0.3.5 # Mdformat plugin for GitHub Flavored Markdown compatibility » https://github.com/hukkin/mdformat-gfm/tags
- mdformat-toc==0.3.0 # Mdformat plugin to generate a table of contents » https://github.com/hukkin/mdformat-toc/tags
- mdformat-shfmt==0.1.0 # Mdformat plugin to format shell code blocks » https://github.com/hukkin/mdformat-shfmt/tags