Skip to content

Commit 459c1c7

Browse files
committed
Validate NEWS files with rstcheck.
1 parent ab250e3 commit 459c1c7

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.github/workflows/python-linters.yml

+14
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ jobs:
4444
run: >-
4545
python -m tox
4646
env: ${{ matrix.env }}
47+
48+
news_format:
49+
name: Check NEWS format
50+
runs-on: ubuntu-18.04
51+
steps:
52+
- uses: actions/checkout@master
53+
- name: Set up Python
54+
uses: actions/setup-python@v1
55+
with:
56+
version: 3.7
57+
- name: Install nox
58+
run: pip install nox
59+
- name: Check NEWS format
60+
run: nox -s validate_news

noxfile.py

+13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Release time helpers, executed using nox.
22
"""
33

4+
import glob
45
import io
56
import subprocess
67

@@ -30,6 +31,18 @@ def get_author_list():
3031
return sorted(authors, key=lambda x: x.lower())
3132

3233

34+
# -----------------------------------------------------------------------------
35+
# Ad-hoc commands
36+
# -----------------------------------------------------------------------------
37+
@nox.session
38+
def validate_news(session):
39+
session.install("rstcheck")
40+
41+
news_files = sorted(glob.glob("news/*"))
42+
43+
session.run("rstcheck", *news_files)
44+
45+
3346
# -----------------------------------------------------------------------------
3447
# Commands used during the release process
3548
# -----------------------------------------------------------------------------

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ filename = "NEWS.rst"
88
directory = "news/"
99
title_format = "{version} ({project_date})"
1010
issue_format = "`#{issue} <https://github.com/pypa/pip/issues/{issue}>`_"
11-
template = "news/_template.rst"
11+
template = "tools/automation/news/template.rst"
1212
type = [
1313
{ name = "Process", directory = "process", showcontent = true },
1414
{ name = "Deprecations and Removals", directory = "removal", showcontent = true },
File renamed without changes.

0 commit comments

Comments
 (0)