Merge pull request #3957 from asottile/changelog_files

Improve pre-commit detection for changelog filenames
This commit is contained in:
Anthony Sottile 2018-09-08 10:58:50 -07:00 committed by GitHub
commit 2c90b3db9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 13 deletions

View File

@ -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
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/

View File

@ -0,0 +1 @@
Improve pre-commit detection for changelog filenames

View File

@ -1,7 +0,0 @@
#!/usr/bin/env python
"""Used by .pre-commit-config.yaml"""
import sys
if __name__ == "__main__":
print(" ".join(sys.argv[1:]))
sys.exit(1)

View File

@ -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]
@ -195,7 +195,7 @@ passenv = *
deps =
colorama
gitpython
pre-commit
pre-commit>=1.11.0
towncrier
wheel
commands = python scripts/release.py {posargs}