Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update trademark_disclaimer to allow for new URL #816

Merged
merged 1 commit into from
Dec 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion clomonitor-core/src/linter/checks/trademark_disclaimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) const CHECK_SETS: [CheckSet; 1] = [CheckSet::Community];
lazy_static! {
#[rustfmt::skip]
pub(crate) static ref TRADEMARK_DISCLAIMER: RegexSet = RegexSet::new(vec![
r"https://(?:w{3}\.)?linuxfoundation.org/trademark-usage",
r"https://(?:w{3}\.)?linuxfoundation.org/(?:legal/)?trademark-usage",
r"The Linux Foundation.* has registered trademarks and uses trademarks",
]).expect("exprs in TRADEMARK_DISCLAIMER to be valid");
}
Expand All @@ -45,7 +45,11 @@ mod tests {
#[test]
fn trademark_disclaimer_match() {
assert!(TRADEMARK_DISCLAIMER.is_match("https://www.linuxfoundation.org/trademark-usage"));
assert!(
TRADEMARK_DISCLAIMER.is_match("https://www.linuxfoundation.org/legal/trademark-usage")
);
assert!(TRADEMARK_DISCLAIMER.is_match("https://linuxfoundation.org/trademark-usage"));
assert!(TRADEMARK_DISCLAIMER.is_match("https://linuxfoundation.org/legal/trademark-usage"));
assert!(TRADEMARK_DISCLAIMER.is_match(
"The Linux Foundation® (TLF) has registered trademarks and uses trademarks."
));
Expand Down
2 changes: 1 addition & 1 deletion docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,6 @@ This check passes if:
- The Linux Foundation trademark disclaimer is found in the content of the website configured in Github. Regexps used:

```sh
"https://(?:w{3}\.)?linuxfoundation.org/trademark-usage"
"https://(?:w{3}\.)?linuxfoundation.org/(?:legal/)?trademark-usage"
"The Linux Foundation.* has registered trademarks and uses trademarks"
```