Skip to content

Commit 9762a5e

Browse files
committed
[beman-tidy] Make readme.implements more lenient
Allow omitting the revision number from the "implements" line in the README.md.
1 parent 4aad0f9 commit 9762a5e

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

tools/beman-tidy/beman_tidy/lib/checks/beman_standard/readme.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ def check(self):
117117
# Match the pattern to start with "Implements:" and then have a paper reference and a wg21.link URL.
118118
# Examples of valid lines:
119119
# **Implements**: [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
120+
# **Implements**: `std::ranges::any_view` proposed in [any_view (P3411)](https://wg21.link/p3411).
120121
# **Implements**: [Give *std::optional* Range Support (P3168R2)](https://wg21.link/P3168R2) and [`std::optional<T&>` (P2988R5)](https://wg21.link/P2988R5)
121122
# **Implements**: [.... (PxyzwRr)](https://wg21.link/PxyzwRr), [.... (PabcdRr)](https://wg21.link/PabcdRr), and [.... (PijklRr)](https://wg21.link/PijklRr),
122-
regex = r"^\*\*Implements\*\*:\s+.*\bP\d{4}R\d+\b.*wg21\.link/\S+"
123+
regex = r"^\*\*Implements\*\*:\s+.*\bP\d{4}R?\d*\b.*wg21\.link/\S+"
123124

124125
# Count how many lines match the regex
125126
implement_lines = 0
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# beman.exemplar: A Beman Library Exemplar
2+
3+
<!-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->
4+
5+
<!-- markdownlint-disable-next-line line-length -->
6+
![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_under_development.svg) ![Continuous Integration Tests](https://github.com/bemanproject/exemplar/actions/workflows/ci_tests.yml/badge.svg) ![Lint Check (pre-commit)](https://github.com/bemanproject/exemplar/actions/workflows/pre-commit.yml/badge.svg) ![Standard Target](https://github.com/bemanproject/beman/blob/main/images/badges/cpp26.svg)
7+
8+
<!-- markdownlint-disable-next-line line-length -->
9+
`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.
10+
11+
**Implements**: `std::ranges::any_view` proposed in [any_view (P3411)](https://wg21.link/p3411).
12+
13+
**Status**: [Under development and not yet ready for production use.](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#under-development-and-not-yet-ready-for-production-use)
14+
15+
## License
16+
17+
This project is licensed under the Apache License 2.0 with LLVM Exceptions.
18+
19+
## Other
20+
21+
<!-- markdownlint-disable-next-line line-length -->
22+
This is a valid README.md file that follows the Beman Standard: the title is properly formatted with the library name and a short description.
23+
24+
This is a valid README.md file that follows the Beman Standard: the badges are properly formatted.
25+
26+
This is a valid README.md file that follows the Beman Standard: the purpose is properly formatted.
27+
28+
This is a valid README.md file that follows the Beman Standard: the implements is properly formatted - omits the paper's revision number.
29+
30+
This is a valid README.md file that follows the Beman Standard: the library status is properly formatted.
31+
32+
This is a valid README.md file that follows the Beman Standard: the license is properly formatted.

tools/beman-tidy/tests/lib/checks/beman_standard/readme/test_readme.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ def test__readme_implements__valid(repo_info, beman_standard_check_config):
169169
Path(f"{valid_prefix}/README-v2.md"),
170170
Path(f"{valid_prefix}/README-v3.md"),
171171
Path(f"{valid_prefix}/README-v4.md"),
172+
Path(f"{valid_prefix}/README-v5.md"),
172173
]
173174

174175
run_check_for_each_path(

0 commit comments

Comments
 (0)