mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
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.
This commit is contained in:
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,18 +1,14 @@
|
|||||||
## What was wrong?
|
### What was wrong?
|
||||||
|
|
||||||
Issue #
|
Related to issue #
|
||||||
|
|
||||||
## How was it fixed?
|
### How was it fixed?
|
||||||
|
|
||||||
Summary of approach.
|
|
||||||
|
|
||||||
### To-Do
|
### To-Do
|
||||||
|
|
||||||
[//]: # (Stay ahead of things, add list items here!)
|
[//]: # (Stay ahead of things, add list items here!)
|
||||||
- [ ] Clean up commit history
|
- [ ] 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/<REPO_NAME>/blob/master/newsfragments/README.md)
|
|
||||||
|
|
||||||
[//]: # (See: https://<RTD_NAME>.readthedocs.io/en/latest/contributing.html#pull-requests)
|
[//]: # (See: https://<RTD_NAME>.readthedocs.io/en/latest/contributing.html#pull-requests)
|
||||||
- [ ] Add entry to the [release notes](https://github.com/ethereum/<REPO_NAME>/blob/master/newsfragments/README.md)
|
- [ ] Add entry to the [release notes](https://github.com/ethereum/<REPO_NAME>/blob/master/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.)
|
relevant to people working on the code itself.)
|
||||||
|
|
||||||
Each file should be named like `<ISSUE>.<TYPE>.rst`, where
|
Each file should be named like `<ISSUE>.<TYPE>.rst`, where
|
||||||
`<ISSUE>` is an issue numbers, and `<TYPE>` is one of:
|
`<ISSUE>` is an issue number, and `<TYPE>` is one of:
|
||||||
|
|
||||||
* `feature`
|
* `feature`
|
||||||
* `bugfix`
|
* `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
|
Note that the `towncrier` tool will automatically
|
||||||
reflow your text, so don't try to do any fancy formatting. Run
|
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.
|
will look like in the final release notes.
|
||||||
|
|||||||
@ -8,19 +8,19 @@ import pathlib
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
ALLOWED_EXTENSIONS = {
|
ALLOWED_EXTENSIONS = {
|
||||||
'.breaking.rst',
|
".breaking.rst",
|
||||||
'.bugfix.rst',
|
".bugfix.rst",
|
||||||
'.doc.rst',
|
".doc.rst",
|
||||||
'.feature.rst',
|
".feature.rst",
|
||||||
'.internal.rst',
|
".internal.rst",
|
||||||
'.misc.rst',
|
".misc.rst",
|
||||||
'.performance.rst',
|
".performance.rst",
|
||||||
'.removal.rst',
|
".removal.rst",
|
||||||
}
|
}
|
||||||
|
|
||||||
ALLOWED_FILES = {
|
ALLOWED_FILES = {
|
||||||
'validate_files.py',
|
"validate_files.py",
|
||||||
'README.md',
|
"README.md",
|
||||||
}
|
}
|
||||||
|
|
||||||
THIS_DIR = pathlib.Path(__file__).parent
|
THIS_DIR = pathlib.Path(__file__).parent
|
||||||
@ -28,7 +28,7 @@ THIS_DIR = pathlib.Path(__file__).parent
|
|||||||
num_args = len(sys.argv) - 1
|
num_args = len(sys.argv) - 1
|
||||||
assert num_args in {0, 1}
|
assert num_args in {0, 1}
|
||||||
if num_args == 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():
|
for fragment_file in THIS_DIR.iterdir():
|
||||||
|
|
||||||
@ -38,7 +38,9 @@ for fragment_file in THIS_DIR.iterdir():
|
|||||||
full_extension = "".join(fragment_file.suffixes)
|
full_extension = "".join(fragment_file.suffixes)
|
||||||
if full_extension not in ALLOWED_EXTENSIONS:
|
if full_extension not in ALLOWED_EXTENSIONS:
|
||||||
raise Exception(f"Unexpected file: {fragment_file}")
|
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}")
|
raise Exception(f"Unexpected file: {fragment_file}")
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Strange: arguments {sys.argv} were validated, but not found")
|
raise RuntimeError(
|
||||||
|
f"Strange: arguments {sys.argv} were validated, but not found"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user