Skip to content

Commit 7a7c45b

Browse files
authored
Merge pull request #213 from vickgoodman/beman-tidy-remove-R-version-of-paper
Added clearer comments to regex pattern
2 parents ceaed54 + 8df70cf commit 7a7c45b

File tree

1 file changed

+8
-7
lines changed
  • beman_tidy/lib/checks/beman_standard

1 file changed

+8
-7
lines changed

beman_tidy/lib/checks/beman_standard/readme.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,22 @@ def __init__(self, repo_info, beman_standard_check_config):
113113
def check(self):
114114
lines = self.read_lines_strip()
115115

116-
# Match the pattern to start with "Implements:" and then have a paper reference and a wg21.link URL.
116+
# Match the pattern to start with "**Implements**:", then have a paper reference with a wg21.link URL.
117117
# Examples of valid lines:
118-
# **Implements**: [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
119-
# **Implements**: `std::ranges::any_view` proposed in [any_view (P3411)](https://wg21.link/p3411).
120-
# **Implements**: [Give *std::optional* Range Support (P3168R2)](https://wg21.link/P3168R2) and [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
121-
# **Implements**: [.... (PxyzwRr)](https://wg21.link/PxyzwRr), [.... (PabcdRr)](https://wg21.link/PabcdRr), and [.... (PijklRr)](https://wg21.link/PijklRr),
118+
# **Implements**: [Standard Library Concepts (P0898)](https://wg21.link/P0898).
119+
# **Implements**: `std::ranges::any_view` proposed in [any_view (P3411R4)](https://wg21.link/p3411r4).
120+
# **Implements**: [Give *std::optional* Range Support (P3168R2)](https://wg21.link/p3168r2) and [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
121+
# **Implements**: [.... (P0000)](https://wg21.link/p0000), [.... (P1111R1)](https://wg21.link/p1111r1), and [.... (P2222)](https://wg21.link/p2222),
122+
122123
regex = r"^\*\*Implements\*\*:\s+.*\bP\d{4}R?\d*\b.*wg21\.link/\S+"
123124

124-
# Count how many lines match the regex
125+
# Count the number of lines that match the regex
125126
implement_lines = 0
126127
for line in lines:
127128
if re.match(regex, line):
128129
implement_lines += 1
129130

130-
# If there is exactly one "Implements:" line, it is valid
131+
# If there is exactly one "**Implements**:" line, it is valid
131132
if implement_lines == 1:
132133
return True
133134

0 commit comments

Comments
 (0)