Skip to content

Commit

Permalink
Fix changes-checker script
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 16, 2021
1 parent f8c30fe commit 8c0dbaf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/check_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,25 @@ def main(argv):
changes = root / "CHANGES"
failed = False
for fname in changes.iterdir():
if fname.name in (".gitignore", ".TEMPLATE.rst"):
if fname.name in (".gitignore", ".TEMPLATE.rst", "README.rst"):
continue
if fname.suffix not in ALLOWED_SUFFIXES:
if fname.suffix == ".rst":
test_name = fname.stem
else:
test_name = fname
if test_name.suffix not in ALLOWED_SUFFIXES:
if not failed:
print("")
print(fname, "has illegal suffix", file=sys.stderr)
failed = True

if failed:
print("", file=sys.stderr)
print("Allowed suffixes are:", ALLOWED_SUFFIXES, file=sys.stderr)
print(
"Allowed suffixes are:",
ALLOWED_SUFFIXES + [suff + ".rst" for suff in ALLOWED_SUFFIXES],
file=sys.stderr,
)
print("", file=sys.stderr)
else:
print("OK")
Expand Down

0 comments on commit 8c0dbaf

Please sign in to comment.