Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- id: changelogs-rst
name: changelog files must end in .rst
entry: ./scripts/fail
language: script
files: 'changelog/.*(?<!\.rst)$'
name: changelog filenames
language: fail
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note here that language: fail is a new pre-commit "language"

entry: 'changelog files must be named ####.(feature|bugfix|doc|removal|vendor|trivial).rst'
exclude: changelog/(\d+\.(feature|bugfix|doc|removal|vendor|trivial).rst|README.rst|_template.rst)
files: ^changelog/
1 change: 1 addition & 0 deletions changelog/3955.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve pre-commit detection for changelog filenames
7 changes: 0 additions & 7 deletions scripts/fail

This file was deleted.

4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ commands =
[testenv:linting]
skip_install = True
basepython = python3.6
deps = pre-commit
deps = pre-commit>=1.11.0
commands = pre-commit run --all-files --show-diff-on-failure

[testenv:py27-xdist]
Expand Down Expand Up @@ -195,7 +195,7 @@ passenv = *
deps =
colorama
gitpython
pre-commit
pre-commit>=1.11.0
towncrier
wheel
commands = python scripts/release.py {posargs}
Expand Down