Improvements for update-authors.py#3110
Open
Jayman2000 wants to merge 3 commits intoansible:develfrom
Open
Conversation
a2846bb to
78e450e
Compare
Before this change, update-authors.py would use a more complicated regex pattern. That pattern would sometimes fail to match anything and result in match() returning None followed by an AttributeError. The old regex pattern already assumed that there would be a "\t" before the information that we’re looking for. This new pattern starts by looking for the "\t" (rather than worrying about what comes before the "\t"). The new pattern also simplifies the rules for matching an author’s name and email. If we really want to enforce rules like “the author’s name must only use word characters and spaces” or “the author’s email must not contain ‘>’”, then we should add a CI check or something. Fixes ansible#3109.
Before this change, there was effectively two for loops, one for the list comprehension and one to iterate over the resulting list. Generating the list wasn’t necessary since the code would just immediately iterate over the list after it was generated, and then never do anything with the list ever again.
Before this change, the pre-commit hook would always delete all of the authors in the AUTHORS files. This was because update-authors.py would get no output from the git shortlog command it ran which would result in update-authors.py crashing with an AttributeError.
78e450e to
b53a4fe
Compare
Author
|
I just pushed a new version of this PR. Here are the changes that I made:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the individual commit messages for details.
Fixes #3109.