Validate NEWS files with rstcheck.

This commit is contained in:
Chris Hunt 2019-09-16 20:52:46 -04:00
parent ab250e3e09
commit 459c1c7e40
4 changed files with 28 additions and 1 deletions

View File

@ -44,3 +44,17 @@ jobs:
run: >-
python -m tox
env: ${{ matrix.env }}
news_format:
name: Check NEWS format
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v1
with:
version: 3.7
- name: Install nox
run: pip install nox
- name: Check NEWS format
run: nox -s validate_news

View File

@ -1,6 +1,7 @@
"""Release time helpers, executed using nox.
"""
import glob
import io
import subprocess
@ -30,6 +31,18 @@ def get_author_list():
return sorted(authors, key=lambda x: x.lower())
# -----------------------------------------------------------------------------
# Ad-hoc commands
# -----------------------------------------------------------------------------
@nox.session
def validate_news(session):
session.install("rstcheck")
news_files = sorted(glob.glob("news/*"))
session.run("rstcheck", *news_files)
# -----------------------------------------------------------------------------
# Commands used during the release process
# -----------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@ filename = "NEWS.rst"
directory = "news/"
title_format = "{version} ({project_date})"
issue_format = "`#{issue} <https://github.com/pypa/pip/issues/{issue}>`_"
template = "news/_template.rst"
template = "tools/automation/news/template.rst"
type = [
{ name = "Process", directory = "process", showcontent = true },
{ name = "Deprecations and Removals", directory = "removal", showcontent = true },