Skip to content

Commit 4705fd2

Browse files
authored
Merge pull request #3765 from asottile/require_changelog_rst
Enforce that changelog files are .rst
2 parents ca04769 + a80e031 commit 4705fd2

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ repos:
3838
language: python
3939
additional_dependencies: [pygments, restructuredtext_lint]
4040
python_version: python3.6
41+
- id: changelogs-rst
42+
name: changelog files must end in .rst
43+
entry: ./scripts/fail
44+
language: script
45+
files: 'changelog/.*(?<!\.rst)$'
File renamed without changes.

scripts/fail

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
"""Used by .pre-commit-config.yaml"""
3+
import sys
4+
5+
if __name__ == "__main__":
6+
print(" ".join(sys.argv[1:]))
7+
sys.exit(1)

0 commit comments

Comments
 (0)