Skip to content

Commit

Permalink
🧪🎨 Enforce empty trivial change notes
Browse files Browse the repository at this point in the history
This is what the contribution document is asking for but the
automation never checked really. Which led to contributors filling
out trivial changelog entries without realizing that they are never
published.

The patch corrects that and relocates the violating change notes to
better sections.
  • Loading branch information
webknjaz committed Jul 15, 2024
1 parent 6e5fb51 commit 508083b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,34 @@ repos:
types_or:
- file
- symlink
- id: trivial-news-fragment-empty
name: Trivial NEWS fragments must be empty
language: python
entry: >-
python3 -Ic 'import pathlib, sys;
trivial_notes = map(pathlib.Path, sys.argv[1:]);
non_empty_notes = [
note for note in trivial_notes
if note.lstat().st_size
];
some_notes_are_non_empty = bool(len(non_empty_notes));
some_notes_are_non_empty or sys.exit(0);
print(f"ERROR: the following change log fragments must be empty:");
print("\n\t* ".join(["", *map(str, non_empty_notes)]));
print();
sys.exit(1)
'
files: ^news/[^.]+\.trivial.*$
types: []
types_or:
- file
- symlink

ci:
autofix_prs: false
Expand Down
2 changes: 0 additions & 2 deletions news/12660.trivial.rst

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions news/12854.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The pre-commit linting suite now makes sure that any change
notes labeled as ``trivial`` are empty.
3 changes: 3 additions & 0 deletions news/setuptools.vendor.rst
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Upgrade setuptools to 70.3.0

Additionally, remove the suppressed deprecation warning from the vendored
``pkg_resources`` copy to ensure builds succeed with ``PYTHONWARNINGS=error``.

0 comments on commit 508083b

Please sign in to comment.