mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
Add gcc.gnu.org account names to MAINTAINERS
As discussed in the thread starting at: https://gcc.gnu.org/pipermail/gcc/2024-June/244199.html it would be useful to have the @gcc.gnu.org bugzilla account names in MAINTAINERS. This is because: (a) Not every non-@gcc.gnu.org email listed in MAINTAINERS is registered as a bugzilla user. (b) Only @gcc.gnu.org accounts tend to have full rights to modify tickets. (c) A maintainer's name and email address aren't always enough to guess the bugzilla account name. (d) The users list on bugzilla has many blank entries for "real name". However, including @gcc.gnu.org to the account name might encourage people to use it for ordinary email, rather than just for bugzilla. This patch goes for the compromise of using the unqualified account name, with some text near the top of the file to explain its usage. There isn't room in the area maintainer sections for a new column, so it seemed better to have the account name only in the Write After Approval section. It's then necessary to list all maintainers there, even if they have more specific roles as well. Also, there were some entries that didn't line up with the prevailing columns (they had one tab too many or one tab too few). It seemed easier to check for and report this, and other things, if the file used spaces rather than tabs. There was one instance of an email address without the trailing ">". The updates to check-MAINTAINERS.py includes a test for that. The account names in the file were taken from a trawl of the gcc-cvs archives, with a very small number of manual edits for ambiguities. There are a handful of names that I couldn't find; the new column has "-" for those. The names were then filtered against the bugzilla @gcc.gnu.org user list, with those not present again being blanked out with "-". ChangeLog: * MAINTAINERS: Replace tabs with spaces. Add a bugzilla account name column to the Write After Approval section. Line up the email column and fix an entry that was missing the trailing ">". contrib/ChangeLog: * check-MAINTAINERS.py (sort_by_surname): Replace with... (get_surname): ...this. (has_tab, is_empty): Delete. (check_group): Take a list of column positions as argument. Check that lines conform to these column numbers. Check that the final column is an email in angle brackets. Record surnames on the fly. (top level): Reject tabs. Use paragraph counts to identify which groups of lines should be checked. Report missing sections.
This commit is contained in:
parent
7d73c01ce6
commit
6fc24a0222
1614
MAINTAINERS
1614
MAINTAINERS
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@
|
|||||||
import locale
|
import locale
|
||||||
import sys
|
import sys
|
||||||
from difflib import ndiff
|
from difflib import ndiff
|
||||||
from itertools import dropwhile, takewhile
|
from itertools import groupby
|
||||||
|
|
||||||
import unidecode
|
import unidecode
|
||||||
|
|
||||||
@ -38,8 +38,7 @@ if len(sys.argv) != 2:
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def sort_by_surname(line):
|
def get_surname(name):
|
||||||
name = line.split('\t')[0]
|
|
||||||
parts = name.split()
|
parts = name.split()
|
||||||
surname = parts[-1]
|
surname = parts[-1]
|
||||||
|
|
||||||
@ -52,35 +51,61 @@ def sort_by_surname(line):
|
|||||||
surname = 'Humieres'
|
surname = 'Humieres'
|
||||||
|
|
||||||
# Remove accents
|
# Remove accents
|
||||||
return (unidecode.unidecode(surname), line)
|
return unidecode.unidecode(surname)
|
||||||
|
|
||||||
|
|
||||||
def has_tab(line):
|
def check_group(name, lines, columns):
|
||||||
return '\t' in line
|
|
||||||
|
|
||||||
|
|
||||||
def is_empty(line):
|
|
||||||
return line
|
|
||||||
|
|
||||||
|
|
||||||
def check_group(name, lines):
|
|
||||||
global exit_code
|
global exit_code
|
||||||
|
|
||||||
|
named_lines = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith(' '):
|
if line.startswith(' '):
|
||||||
print(f'Line should not start with space: "{line}"')
|
print(f'Line should not start with space: "{line}"')
|
||||||
exit_code = 2
|
exit_code = 2
|
||||||
|
continue
|
||||||
|
|
||||||
|
if line.endswith(' '):
|
||||||
|
print(f'Line should not end with space: "{line}"')
|
||||||
|
exit_code = 3
|
||||||
|
continue
|
||||||
|
|
||||||
# Special-case some names
|
# Special-case some names
|
||||||
if line == 'James Norris':
|
if line == 'James Norris':
|
||||||
|
named_lines.append((get_surname(line), line + "\n"))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if '\t' not in line:
|
pieces = []
|
||||||
print(f'Name and email should be separated by tabs: "{line}"')
|
for i, column in enumerate(columns):
|
||||||
exit_code = 2
|
piece = ""
|
||||||
|
if len(line) <= column:
|
||||||
|
print(f'Line too short: "{line}"')
|
||||||
|
exit_code = 4
|
||||||
|
elif column > 0 and line[column - 1] != ' ':
|
||||||
|
print(f'Column {column - 1} should be empty: "{line}"')
|
||||||
|
exit_code = 5
|
||||||
|
elif line[column] == ' ':
|
||||||
|
print(f'Column {column} should be nonempty: "{line}"')
|
||||||
|
exit_code = 6
|
||||||
|
elif i == len(columns) - 1:
|
||||||
|
piece = line[column:].rstrip()
|
||||||
|
else:
|
||||||
|
piece = line[column:columns[i + 1]].rstrip()
|
||||||
|
|
||||||
lines = [line + '\n' for line in lines]
|
if " " in piece:
|
||||||
sorted_lines = sorted(lines, key=sort_by_surname)
|
print(f'Malformed field at column {column}: "{line}"')
|
||||||
|
exit_code = 7
|
||||||
|
|
||||||
|
pieces.append(piece)
|
||||||
|
|
||||||
|
named_lines.append((get_surname(pieces[0]), line + "\n"))
|
||||||
|
|
||||||
|
email = pieces[-1]
|
||||||
|
if email and (not email.startswith('<') or not email.endswith('>')):
|
||||||
|
print(f'Malformed email address: "{line}"')
|
||||||
|
exit_code = 8
|
||||||
|
|
||||||
|
lines = [line + "\n" for line in lines]
|
||||||
|
sorted_lines = [line for _, line in sorted(named_lines)]
|
||||||
if lines != sorted_lines:
|
if lines != sorted_lines:
|
||||||
exit_code = 1
|
exit_code = 1
|
||||||
diff = ndiff(lines, sorted_lines)
|
diff = ndiff(lines, sorted_lines)
|
||||||
@ -90,32 +115,35 @@ def check_group(name, lines):
|
|||||||
print(f'{name} are fine!')
|
print(f'{name} are fine!')
|
||||||
|
|
||||||
|
|
||||||
lines = open(sys.argv[1]).read().splitlines()
|
text = open(sys.argv[1]).read()
|
||||||
|
if '\t' in text:
|
||||||
|
print('The file should not contain tabs')
|
||||||
|
exit_code = 9
|
||||||
|
|
||||||
needle = 'Global Reviewers'
|
sections = [
|
||||||
lines = list(dropwhile(lambda x: x.strip() != needle, lines))
|
# heading, paragraph index, column numbers
|
||||||
lines = lines[2:]
|
('Global Reviewers', 1, [0, 48]),
|
||||||
|
('Write After Approval', 2, [0, 32, 48]),
|
||||||
|
('Bug database only accounts', 1, [0, 48]),
|
||||||
|
('Contributing under the DCO', 2, [0, 48])
|
||||||
|
]
|
||||||
|
|
||||||
chunk = list(takewhile(is_empty, lines))
|
i = 0
|
||||||
check_group(needle, chunk)
|
count = 0
|
||||||
|
for is_empty, lines in groupby(text.splitlines(), lambda x: not x):
|
||||||
|
if is_empty:
|
||||||
|
continue
|
||||||
|
lines = list(lines)
|
||||||
|
if count > 0:
|
||||||
|
count -= 1
|
||||||
|
if count == 0:
|
||||||
|
check_group(sections[i][0], lines, sections[i][2])
|
||||||
|
i += 1
|
||||||
|
elif len(lines) == 1 and i < len(sections) and sections[i][0] in lines[0]:
|
||||||
|
count = sections[i][1]
|
||||||
|
|
||||||
needle = 'Write After Approval'
|
if i < len(sections):
|
||||||
lines = list(dropwhile(lambda x: needle not in x, lines))
|
print(f'Missing "{sections[i][0]}" section')
|
||||||
lines = lines[2:]
|
exit_code = 10
|
||||||
|
|
||||||
chunk = list(takewhile(is_empty, lines))
|
|
||||||
check_group(needle, chunk)
|
|
||||||
|
|
||||||
needle = 'Bug database only accounts'
|
|
||||||
lines = list(dropwhile(lambda x: needle not in x, lines))
|
|
||||||
lines = lines[2:]
|
|
||||||
|
|
||||||
chunk = list(takewhile(is_empty, lines))
|
|
||||||
check_group(needle, chunk)
|
|
||||||
|
|
||||||
needle = 'Contributing under the DCO'
|
|
||||||
lines = list(dropwhile(lambda x: needle not in x, lines))[1:]
|
|
||||||
lines = list(dropwhile(lambda x: not has_tab(x), lines))
|
|
||||||
check_group(needle, lines)
|
|
||||||
|
|
||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user