-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
119 lines (119 loc) · 3.89 KB
/
.pre-commit-config.yaml
File metadata and controls
119 lines (119 loc) · 3.89 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=550']
- id: check-ast
- id: check-merge-conflict
- id: check-json
exclude: |
(?x)^(
lib/lp/services/sitesearch/tests/data/bingsearchservice-incomplete-response\.json
)$
- id: check-xml
exclude: |
(?x)^(
lib/lp/bugs/tests/testfiles/broken_bug_li_item\.xml|
lib/lp/bugs/tests/testfiles/unescaped_control_character.xml
)$
- id: check-yaml
- id: debug-statements
exclude: systemdocs\.py
- id: file-contents-sorter
files: ^\.codespell-ignore
- id: no-commit-to-branch
args: [--branch, master, --branch, db-devel]
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--keep-percent-format, --py38-plus]
exclude: |
(?x)^(
lib/contrib/.*
|utilities/community-contributions\.py
)$
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
hooks:
- id: black
exclude: |
(?x)^(
lib/contrib/.*
|utilities/community-contributions\.py
)$
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
args: [--profile, black]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
exclude: ^lib/contrib/
additional_dependencies:
- flake8-absolute-import==1.0.0.1
- flake8-bugbear==23.3.12
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.12.0
hooks:
- id: eslint
args: [--quiet]
# 20.7.0 upgraded from npm 9.8.1 to 10.1.0, which appears to fail to
# use the proxy correctly in Launchpad CI builds.
language_version: "20.6.1"
additional_dependencies:
- "@microsoft/[email protected]"
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc
args: ["-l", "78"]
# blackdoc v0.3.9 isn't compatible with black versions where
# black.decode_bytes requires a "mode" argument.
# Pin black for this hook to keep commits unblocked.
additional_dependencies:
- black==24.8.0
- repo: https://git.launchpad.net/lp-lint-doctest
rev: '0.5'
hooks:
- id: lp-lint-doctest
args: [--allow-option-flag, IGNORE_EXCEPTION_MODULE_IN_PYTHON2]
# lp-lint-doctest 0.5 expects pyflakes messages formatted as
# "file:line: message". Newer pyflakes formats include a column, e.g.
# "(none):1:1: message" (extra ":"), which makes lp-lint-doctest crash:
# Pin pyflakes to avoid lp-lint-doctest crashing with:
# ValueError: too many values to unpack (expected 3)
additional_dependencies:
- pyflakes==2.4.0
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["-I", ".codespell-ignore"]
files: ^(.*\.js|.*\.rst)$
exclude: |
(?x)^(
# URL-encoding of "foö".
lib/lp/bugs/doc/bugattachments\.rst
# Quoted-printable encoding.
|lib/lp/code/doc/branch-notifications\.rst
# Word truncated by stemming.
|lib/lp/services/database/doc/textsearching\.rst
)$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
hooks:
- id: bandit
args: [-c, pyproject.toml, --severity-level, high]
additional_dependencies: ['bandit[toml]']