Meta: Fix Ports table linter when there's only one space after the link

With prettier formatting, at least one port's row
will be formatted such that there is only one
space, but the previous regex required at least
two spaces. Disregarding the fact that we probably
shouldn't parse markdown with a regex, this fixes
the issue for now.
This commit is contained in:
kleines Filmröllchen 2024-09-11 16:32:51 +02:00 committed by Nico Weber
parent c408723257
commit 7eb1534c54

View file

@ -12,7 +12,7 @@ from tempfile import NamedTemporaryFile
# and captures "bash" in group 1, "bash/" in group 2, "<spaces>" in group 3, "GNU Bash" in group 4, "5.0" in group 5
# and "https://www.gnu.org/software/bash/" in group 6.
PORT_TABLE_REGEX = re.compile(
r'^\| \[`([^`]+)`\]\(([^\)]+)\)([^\|]+) \| ([^\|]+) \| ([^\|]+?) \| ([^\|]+) \|+$', re.MULTILINE
r'^\| \[`([^`]+)`\]\(([^\)]+)\)([^\|]+)\| ([^\|]+) \| ([^\|]+?) \| ([^\|]+) \|+$', re.MULTILINE
)
# Matches non-abbreviated git hashes