-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path.pre-commit-config.yaml
113 lines (113 loc) · 3.41 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# Install pre-commit itself:
# $ pip install pre-commit
# OR
# $ brew install pre-commit
#
# Update all pre-commit hooks to latest version:
# $ pre-commit autoupdate
#
# Install all pre-commit hooks locally:
# $ pre-commit install
#
# Apply a given pre-commit hook to all files:
# $ pre-commit run --all-files <id>
#
# Apply all pre-commit hooks to all files:
# $ pre-commit run --all-files
exclude: '^wpt'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-yaml
- id: end-of-file-fixer
- id: name-tests-test
args: [--pytest-test-first]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/flake8.git
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.34.0
hooks:
- id: eslint
files: \.[jt]s$
types: [file]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
additional_dependencies:
- repo: https://github.com/google/yapf
rev: v0.32.0
hooks:
- id: yapf
args: ['--in-place', '--parallel']
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies: [types-requests]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
hooks:
- id: shellcheck
- repo: https://github.com/codespell-project/codespell
rev: 'v2.2.2'
hooks:
- id: codespell
# skip false positives
args: [--skip=package-lock.json, --skip=tests/test_screenshot.py]
- repo: local
hooks:
- id: copyright
name: check copyright
entry: |-
.* Copyright [0-9]+ Google LLC.
.* Copyright \(c\) Microsoft Corporation.
.*
.* Licensed under the Apache License, Version 2.0 \(the "License"\);
.* you may not use this file except in compliance with the License.
.* You may obtain a copy of the License at
.*
.* http://www.apache.org/licenses/LICENSE-2.0
.*
.* Unless required by applicable law or agreed to in writing, software
.* distributed under the License is distributed on an "AS IS" BASIS,
.* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.* See the License for the specific language governing permissions and
.* limitations under the License.
language: pygrep
files: \.js$|\.cjs$|\.mjs$|\.ts$|\.py$
args: [--negate, --multiline]
- id: check-chai-describe-it-only
name: check chai describe & it `.only()`
entry: '\b(it|describe)\.only\('
language: pygrep
files: \.spec\.ts$
- id: node-self
name: check nodejs `self.`
entry: '\bself\.'
language: pygrep
files: \.ts$
- repo: https://github.com/google/keep-sorted
rev: v0.1.1
hooks:
- id: keep-sorted