Skip to content

Commit 2c90b3d

Browse files
authored
Merge pull request #3957 from asottile/changelog_files
Improve pre-commit detection for changelog filenames
2 parents 3dd2933 + 826adaf commit 2c90b3d

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ repos:
3838
language: python
3939
additional_dependencies: [pygments, restructuredtext_lint]
4040
- id: changelogs-rst
41-
name: changelog files must end in .rst
42-
entry: ./scripts/fail
43-
language: script
44-
files: 'changelog/.*(?<!\.rst)$'
41+
name: changelog filenames
42+
language: fail
43+
entry: 'changelog files must be named ####.(feature|bugfix|doc|removal|vendor|trivial).rst'
44+
exclude: changelog/(\d+\.(feature|bugfix|doc|removal|vendor|trivial).rst|README.rst|_template.rst)
45+
files: ^changelog/

changelog/3955.trivial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve pre-commit detection for changelog filenames

scripts/fail

Lines changed: 0 additions & 7 deletions
This file was deleted.

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ commands =
4848
[testenv:linting]
4949
skip_install = True
5050
basepython = python3.6
51-
deps = pre-commit
51+
deps = pre-commit>=1.11.0
5252
commands = pre-commit run --all-files --show-diff-on-failure
5353

5454
[testenv:py27-xdist]
@@ -195,7 +195,7 @@ passenv = *
195195
deps =
196196
colorama
197197
gitpython
198-
pre-commit
198+
pre-commit>=1.11.0
199199
towncrier
200200
wheel
201201
commands = python scripts/release.py {posargs}

0 commit comments

Comments
 (0)