Skip to content

Commit 9b52ea5

Browse files
authored
Merge pull request #216 from vickgoodman/beman-tidy-additional-tests-readme-implements
[beman-tidy] Updated regex and examples for readme.implements
2 parents 0c937ec + ecbf4f8 commit 9b52ea5

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

beman_tidy/lib/checks/beman_standard/readme.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,16 @@ 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**:", then have a paper reference with a wg21.link URL.
116+
# Matches lines starting with "**Implements**:" that reference a WG21 paper
117+
# and include a corresponding https://wg21.link/Pxxxx[Rx] URL
118+
117119
# Examples of valid lines:
118120
# **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**: `std::ranges::any_view` proposed in [any_view (p3411r4)](https://wg21.link/p3411r4).
122+
# **Implements**: [Give *std::optional* Range Support (P3168R2)](https://wg21.link/p3168r2) and [`std::optional<T&>` (p2988r5)](https://wg21.link/P2988R5)
121123
# **Implements**: [.... (P0000)](https://wg21.link/p0000), [.... (P1111R1)](https://wg21.link/p1111r1), and [.... (P2222)](https://wg21.link/p2222),
122124

123-
regex = r"^\*\*Implements\*\*:\s+.*\bP\d{4}R?\d*\b.*wg21\.link/\S+"
124-
125+
regex = r"^\*\*Implements\*\*:\s+.*\b[pP]\d{4}(?:[rR]\d+)?\b.*wg21\.link/[pP]\d{4}(?:[rR]\d+)?\b"
125126
# Count the number of lines that match the regex
126127
implement_lines = 0
127128
for line in lines:

tests/lib/checks/beman_standard/readme/data/valid/README-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- markdownlint-disable-next-line line-length -->
99
`beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
1010

11-
**Implements**: `std::identity` proposed in [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
11+
**Implements**: `std::ranges::any_view` proposed in [any_view (p3411r4)](https://wg21.link/p3411r4).
1212

1313
**Status**: [Production ready. API may undergo changes.](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#production-ready-api-may-undergo-changes)
1414

tests/lib/checks/beman_standard/readme/data/valid/README-v3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- markdownlint-disable-next-line line-length -->
99
`beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
1010

11-
**Implements**: `std::identity` proposed in [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
11+
**Implements**: [Give *std::optional* Range Support (p3168r2)](https://wg21.link/p3168r2) and [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
1212

1313
<!-- markdownlint-disable-next-line line-length -->
1414
**Status**: [Production ready. Stable API.](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#production-ready-stable-api)

tests/lib/checks/beman_standard/readme/data/valid/README-v4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- markdownlint-disable-next-line line-length -->
99
`beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md). This can be used as a template for those intending to write Beman libraries. It may also find use as a minimal and modern C++ project structure.
1010

11-
**Implements**: `std::identity` proposed in [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
11+
**Implements**: `std::identity` proposed in [Standard Library Concepts (p0898r3)](https://wg21.link/P0898R3).
1212

1313
**Status**: [Retired. No longer maintained or actively developed.](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#retired-no-longer-maintained-or-actively-developed)
1414

0 commit comments

Comments
 (0)