Skip to content

Commit

Permalink
Simplify author regex in update-authors.py
Browse files Browse the repository at this point in the history
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 #3109.
  • Loading branch information
Jayman2000 committed Feb 18, 2023
1 parent 95f1c1f commit a8e8066
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
33 changes: 32 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,55 @@ Adrian Likins <[email protected]>
Alexander Saprykin <[email protected]>
Andrew Crosby <[email protected]>
Brian Coca <[email protected]>
Brian McLaughlin <[email protected]>
Calvin Spealman <[email protected]>
Chris Church <[email protected]>
Chris Houseknecht <[email protected]>
Chris Meyers <[email protected]>
Christopher Chase <[email protected]>
David Davis <[email protected]>
David Moreau Simard <[email protected]>
David Newswanger <[email protected]>
David Zager <[email protected]>
Dostonbek <[email protected]>
Dostonbek Toirov <[email protected]>
Egor Margineanu <[email protected]>
Evgeni Golov <[email protected]>
Guillaume Delacour <[email protected]>
Ivan <[email protected]>
Ivan Remizov <[email protected]>
Jake Jackson <[email protected]>
James Cammarata <[email protected]>
Jason Yundt <[email protected]>
Jeff Geerling <[email protected]>
Jiri Tyr <[email protected]>
Joe Fiorini <[email protected]>
John Corrales <[email protected]>
John R Barker <[email protected]>
John R Barker <[email protected]>
Jorge Heleno <[email protected]>
Jürgen Etzlstorfer <[email protected]>
Karl Goetz <[email protected]>
Kevin Breit <[email protected]>
Khrystyna Bugaienko <[email protected]>
Kyle <[email protected]>
Leon M. George <[email protected]>
Martin Hradil <[email protected]>
Martin Krizek <[email protected]>
Nicolas Quiniou-Briand <[email protected]>
Paul Belanger <[email protected]>
Paul Belanger <[email protected]>
Paul dG <[email protected]>
Ryuichi Watanabe <[email protected]>
Samy Coenen <[email protected]>
Sandra McCann <[email protected]>
Strix <[email protected]>
Sviatoslav Sydorenko <[email protected]>
Thad Guidry <[email protected]>
Till! <[email protected]>
Timothy Appnel <[email protected]>
Yanis Guenane <[email protected]>
cclauss <[email protected]>
ironfroggy <[email protected]>
ironfroggy <[email protected]>
jawyoonis <[email protected]>
jctanner <[email protected]>
4 changes: 2 additions & 2 deletions update-authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import re
import subprocess

author_re = re.compile(r'^\s*\d+\t([\w ]+ <[^>]+>)$')
author_re = re.compile(r'(?<=\t).*')

git_log = subprocess.check_output(['git', 'shortlog', '--summary', '--email'])
log_entries = git_log.decode('utf-8').strip().split('\n')
authors = [author_re.match(entry).group(1) for entry in log_entries]
authors = [author_re.search(entry).group(0) for entry in log_entries]


print("Galaxy has been contribued to by the following authors:\n"
Expand Down

0 comments on commit a8e8066

Please sign in to comment.