Skip to content

Improvements for update-authors.py#3110

Open
Jayman2000 wants to merge 3 commits intoansible:develfrom
Jayman2000:update-authors-improvements
Open

Improvements for update-authors.py#3110
Jayman2000 wants to merge 3 commits intoansible:develfrom
Jayman2000:update-authors-improvements

Conversation

@Jayman2000
Copy link
Copy Markdown

See the individual commit messages for details.

Fixes #3109.

@Jayman2000 Jayman2000 force-pushed the update-authors-improvements branch 2 times, most recently from a2846bb to 78e450e Compare June 13, 2023 20:52
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.
@Jayman2000 Jayman2000 force-pushed the update-authors-improvements branch from 78e450e to b53a4fe Compare December 4, 2024 18:19
@Jayman2000
Copy link
Copy Markdown
Author

I just pushed a new version of this PR. Here are the changes that I made:

  • I rebased the PR on the tip of the devel branch (3c592a5, at the moment).
  • I fixed the fact that this PR unintentionally deleted the contents of the AUTHORS file.

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