Skip to content

Commit ceaed54

Browse files
authored
Removed MIT as a supported license
Pull request #212
1 parent 2386f68 commit ceaed54

File tree

8 files changed

+11
-52
lines changed

8 files changed

+11
-52
lines changed

beman_tidy/lib/checks/beman_standard/license.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from beman_tidy.lib.utils.git import get_beman_recommendated_license_path
1010
from beman_tidy.lib.utils.string import (
1111
match_apache_license_v2_with_llvm_exceptions,
12-
match_boost_software_license_v1_0,
13-
match_the_mit_license,
12+
match_boost_software_license_v1_0
1413
)
1514

1615
# [license.*] checks category.
@@ -46,10 +45,6 @@ def check(self):
4645
)
4746
return True
4847

49-
if match_the_mit_license(content):
50-
self.log("Valid MIT License found in LICENSE file.", log_level="info")
51-
return True
52-
5348
self.log(
5449
"Invalid license - cannot find approved license in LICENSE file. "
5550
"See https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md#licenseapproved for more information."

beman_tidy/lib/checks/beman_standard/readme.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from ..system.registry import register_beman_standard_check
88
from beman_tidy.lib.utils.string import (
99
match_apache_license_v2_with_llvm_exceptions,
10-
match_boost_software_license_v1_0,
11-
match_the_mit_license,
10+
match_boost_software_license_v1_0
1211
)
1312

1413

@@ -197,7 +196,6 @@ def check(self):
197196
if (
198197
not match_apache_license_v2_with_llvm_exceptions(license_text)
199198
and not match_boost_software_license_v1_0(license_text)
200-
and not match_the_mit_license(license_text)
201199
):
202200
self.log(
203201
f"The file '{self.path}' does not contain the required license. "

beman_tidy/lib/utils/string.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,6 @@ def match_boost_software_license_v1_0(content):
119119
return True
120120

121121

122-
def match_the_mit_license(content):
123-
# beman/LICENSE contains the following text (multiple lines)
124-
# - The MIT License
125-
#
126-
# We also check for variations.
127-
#
128-
license_regex = [
129-
rf"The MIT License", # noqa: F541
130-
rf"MIT License", # noqa: F541
131-
]
132-
if not any(
133-
re.search(regex, content, re.IGNORECASE) is not None for regex in license_regex
134-
):
135-
return False
136-
137-
return True
138-
139-
140122
def skip_lines(lines, n):
141123
return lines[n:] if lines is not None else None
142124

tests/lib/checks/beman_standard/license/data/valid/valid-LICENSE-v3

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/lib/checks/beman_standard/license/test_license.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def test__license_approved__valid(repo_info, beman_standard_check_config):
2828
# Apache License v2.0 with LLVM Exceptions
2929
Path(f"{valid_prefix}/valid-LICENSE-v1"),
3030
# Boost Software License - Version 1.0
31-
Path(f"{valid_prefix}/valid-LICENSE-v2"),
32-
# The MIT License
33-
Path(f"{valid_prefix}/valid-LICENSE-v3"),
31+
Path(f"{valid_prefix}/valid-LICENSE-v2")
3432
]
3533

3634
run_check_for_each_path(
@@ -91,9 +89,7 @@ def test__license_apache_llvm__invalid(repo_info, beman_standard_check_config):
9189
"""
9290
invalid_license_paths = [
9391
# Boost Software License 1.0 is license.approved compatible, but not compatible with license.apache_llvm.
94-
Path(f"{valid_prefix}/valid-LICENSE-v2"),
95-
# MIT License is license.approved compatible, but not compatible with license.apache_llvm.
96-
Path(f"{valid_prefix}/valid-LICENSE-v3"),
92+
Path(f"{valid_prefix}/valid-LICENSE-v2")
9793
]
9894

9995
run_check_for_each_path(

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_production_ready_stable_api.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/cpp29.svg)
77

88
<!-- 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.
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.
1010

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

@@ -15,11 +15,7 @@ beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](http
1515

1616
## License
1717

18-
This project is licensed under the MIT License.
19-
20-
## Other
21-
22-
This is a valid README.md file that follows the Beman Standard: the license is properly formatted - MIT License.
18+
This project is licensed under the Apache License 2.0 with LLVM Exceptions.
2319

2420
## Other
2521

@@ -30,8 +26,8 @@ This is a valid README.md file that follows the Beman Standard: the badges are p
3026

3127
This is a valid README.md file that follows the Beman Standard: the purpose is properly formatted.
3228

33-
This is a valid README.md file that follows the Beman Standard: the implements is properly formatted.
29+
This is a valid README.md file that follows the Beman Standard: the implements is properly formatted - omits the paper's revision number.
3430

3531
This is a valid README.md file that follows the Beman Standard: the library status is properly formatted.
3632

37-
This is a valid README.md file that follows the Beman Standard: the license is properly formatted - MIT License.
33+
This is a valid README.md file that follows the Beman Standard: the license is properly formatted - Apache License.

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
@@ -14,7 +14,7 @@
1414

1515
## License
1616

17-
This project is licensed under the Apache License 2.0 with LLVM Exceptions blah blah, and for tooling, the docs are under the MIT License.
17+
This project is licensed under the Apache License 2.0 with LLVM Exceptions blah blah, and for tooling, the docs are under the Boost .
1818

1919
## Other
2020

tests/lib/checks/beman_standard/readme/test_readme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ def test__readme_license__valid(repo_info, beman_standard_check_config):
269269
Path(f"{valid_prefix}/README-v1.md"),
270270
# License: Boost Software License 1.0
271271
Path(f"{valid_prefix}/README-v2.md"),
272-
# License: MIT License
272+
# License: Apache License 2.0 with LLVM Exceptions
273273
Path(f"{valid_prefix}/README-v3.md"),
274-
# License: Apache License 2.0 with LLVM Exceptions and MIT License
274+
# License: Apache License 2.0 with LLVM Exceptions and Boost
275275
Path(f"{valid_prefix}/README-v4.md"),
276276
]
277277

0 commit comments

Comments
 (0)