From 3ff1c9cf5d6d1867bc1216e586c65f787e15c0e3 Mon Sep 17 00:00:00 2001 From: fselmo Date: Mon, 21 Nov 2022 17:25:08 -0700 Subject: [PATCH] Minor refactoring / cleanup - Clean up github PR template to remove double links to the newsfragment README.md - Clean up some typos and make some minor refactors. --- .github/PULL_REQUEST_TEMPLATE.md | 10 +++------- newsfragments/README.md | 4 ++-- newsfragments/validate_files.py | 28 +++++++++++++++------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 21d4db59..54da5516 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,18 +1,14 @@ -## What was wrong? +### What was wrong? -Issue # +Related to issue # -## How was it fixed? - -Summary of approach. +### How was it fixed? ### To-Do [//]: # (Stay ahead of things, add list items here!) - [ ] Clean up commit history -[//]: # (For important changes that should go into the release notes please add a newsfragment file as explained here: https://github.com/ethereum//blob/master/newsfragments/README.md) - [//]: # (See: https://.readthedocs.io/en/latest/contributing.html#pull-requests) - [ ] Add entry to the [release notes](https://github.com/ethereum//blob/master/newsfragments/README.md) diff --git a/newsfragments/README.md b/newsfragments/README.md index f98aef6e..e4740e4b 100644 --- a/newsfragments/README.md +++ b/newsfragments/README.md @@ -6,7 +6,7 @@ commit message and PR description, which are a description of the change as relevant to people working on the code itself.) Each file should be named like `..rst`, where -`` is an issue numbers, and `` is one of: +`` is an issue number, and `` is one of: * `feature` * `bugfix` @@ -24,5 +24,5 @@ then open up the PR first and use the PR number for the newsfragment. Note that the `towncrier` tool will automatically reflow your text, so don't try to do any fancy formatting. Run - `towncrier build --draft` to get a preview of what the release notes entry +`towncrier build --draft` to get a preview of what the release notes entry will look like in the final release notes. diff --git a/newsfragments/validate_files.py b/newsfragments/validate_files.py index 0a13ec2a..684c7987 100755 --- a/newsfragments/validate_files.py +++ b/newsfragments/validate_files.py @@ -8,19 +8,19 @@ import pathlib import sys ALLOWED_EXTENSIONS = { - '.breaking.rst', - '.bugfix.rst', - '.doc.rst', - '.feature.rst', - '.internal.rst', - '.misc.rst', - '.performance.rst', - '.removal.rst', + ".breaking.rst", + ".bugfix.rst", + ".doc.rst", + ".feature.rst", + ".internal.rst", + ".misc.rst", + ".performance.rst", + ".removal.rst", } ALLOWED_FILES = { - 'validate_files.py', - 'README.md', + "validate_files.py", + "README.md", } THIS_DIR = pathlib.Path(__file__).parent @@ -28,7 +28,7 @@ THIS_DIR = pathlib.Path(__file__).parent num_args = len(sys.argv) - 1 assert num_args in {0, 1} if num_args == 1: - assert sys.argv[1] in ('is-empty', ) + assert sys.argv[1] in ("is-empty",) for fragment_file in THIS_DIR.iterdir(): @@ -38,7 +38,9 @@ for fragment_file in THIS_DIR.iterdir(): full_extension = "".join(fragment_file.suffixes) if full_extension not in ALLOWED_EXTENSIONS: raise Exception(f"Unexpected file: {fragment_file}") - elif sys.argv[1] == 'is-empty': + elif sys.argv[1] == "is-empty": raise Exception(f"Unexpected file: {fragment_file}") else: - raise RuntimeError("Strange: arguments {sys.argv} were validated, but not found") + raise RuntimeError( + f"Strange: arguments {sys.argv} were validated, but not found" + )