From c5744d5643a2a4fbbaaaa5352af77ad6dce19e16 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 26 Apr 2020 20:40:25 +0530 Subject: [PATCH] Enforce news/*.{correct-kind}.rst naming --- .pre-commit-config.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a62a90f64c..13b3abc62bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,11 +85,18 @@ repos: - id: python-no-log-warn - id: python-no-eval - id: rst-backticks - # Validate existing ReST files and NEWS fragments. - files: .*\.rst$|^news/.* + files: .*\.rst$ types: [file] - # The errors flagged in NEWS.rst are old. - exclude: NEWS.rst + exclude: NEWS.rst # The errors flagged in NEWS.rst are old. + +- repo: local + hooks: + - id: news-fragment-filenames + name: NEWS fragment + language: fail + entry: NEWS fragment files must be named *.(process|removal|feature|bugfix|vendor|doc|trivial).rst + exclude: ^news/(.gitignore|.*\.(process|removal|feature|bugfix|vendor|doc|trivial).rst) + files: ^news/ - repo: https://github.com/mgedmin/check-manifest rev: '0.43'