Skip to content

Commit

Permalink
BaseTools/GetMaintainer.py: Add GitHub username argument
Browse files Browse the repository at this point in the history
Adds a new `-g` parameter so that output will also include the GitHub
username.

This change uses a simple regular expression as opposed to directly
returning the original line from the file to make the extraction of
GitHub usernames more robust to other changes on the line in the
maintainers text file.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki committed Jul 24, 2024
1 parent 5eaa983 commit 69f0dcd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions BaseTools/Scripts/GetMaintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def get_modified_files(repo, args):
PARSER.add_argument('-l', '--lookup',
help='Find section matches for path LOOKUP',
required=False)
PARSER.add_argument('-g', '--github',
action='store_true',
help='Include GitHub usernames in output',
required=False)
ARGS = PARSER.parse_args()

REPO = SetupGit.locate_repo()
Expand All @@ -203,5 +207,8 @@ def get_modified_files(repo, args):

for address in ADDRESSES:
if '<' in address and '>' in address:
address = address.split('>', 1)[0] + '>'
print(' %s' % address)
address, github_id = address.split('>', 1)
address = address + '>'
github_id = github_id.strip() if ARGS.github else ''

print(' %s %s' % (address, github_id))

0 comments on commit 69f0dcd

Please sign in to comment.