Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for update-authors.py #3110

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

Jayman2000
Copy link

See the individual commit messages for details.

Fixes #3109.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update-authors.py doesn’t work
1 participant