Skip to content

Commit 6473ff1

Browse files
committed
strip leading dots from copyright statements
1 parent 656c31c commit 6473ff1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/tools/collect-license-metadata/src/licenses.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub(crate) struct License {
4242
impl License {
4343
fn simplify(&mut self) {
4444
self.remove_copyright_prefixes();
45+
self.remove_trailing_dots();
4546
self.copyright.sort();
4647
self.copyright.dedup();
4748
}
@@ -62,4 +63,12 @@ impl License {
6263
*copyright = stripped.into();
6364
}
6465
}
66+
67+
fn remove_trailing_dots(&mut self) {
68+
for copyright in &mut self.copyright {
69+
if copyright.ends_with('.') {
70+
*copyright = copyright.trim_end_matches('.').to_string();
71+
}
72+
}
73+
}
6574
}

0 commit comments

Comments
 (0)