Skip to content

Commit ad84b2a

Browse files
committed
license-scan: add latest spdx license data
The latest SPDX data includes the Pixar license, which is a modified Apache-2.0 license. This rare license often confuses the scanner when it encounters the common Apache-2.0 license, so a new config option `spdx.ignore-licenses` has been added to ignore specific licenses from the input SPDX data. This change also adds the ability to skip directories when scanning sources. This is useful for scanning the source directory filled with sample license texts in the spdx crate itself.
1 parent 1fe65a6 commit ad84b2a

File tree

7 files changed

+251
-29
lines changed

7 files changed

+251
-29
lines changed

configs/cargo-deny/clarify.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[spdx]
2+
ignore-licenses = [
3+
# Apache-2.0 is often misclassified as Pixar, which is a significantly more rare
4+
# https://github.com/jpeddicord/askalono/issues/94
5+
"Pixar"
6+
]
7+
18
[clarify.askalono]
29
expression = "Apache-2.0"
310
license-files = [

configs/cargo-make/clarify.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[spdx]
2+
ignore-licenses = [
3+
# Apache-2.0 is often misclassified as Pixar, which is a significantly more rare
4+
# https://github.com/jpeddicord/askalono/issues/94
5+
"Pixar"
6+
]
7+
18
[clarify.bstr]
29
expression = "(MIT OR Apache-2.0) AND Unicode-DFS-2016"
310
license-files = [

license-scan/Cargo.lock

Lines changed: 81 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

license-scan/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ ignore = "0.4"
1717
lazy_static = "1"
1818
semver = { version = "1", features = ["serde"] }
1919
serde = { version = "1", features = ["derive"] }
20-
spdx = "0.3"
20+
spdx = "0.10"
2121
structopt = { version = "0.3", default-features = false }
22+
tempfile = "3"
2223
toml = "0.8"
2324
twox-hash = "1"
2425
walkdir = "2"

license-scan/clarify.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[spdx]
2+
ignore-licenses = [
3+
# Apache-2.0 is often misclassified as Pixar, which is a significantly more rare
4+
# https://github.com/jpeddicord/askalono/issues/94
5+
"Pixar"
6+
]
7+
18
[clarify.askalono]
29
expression = "Apache-2.0"
310
license-files = [
@@ -21,7 +28,6 @@ license-files = [
2128
{ path = "COPYING", hash = 0x278afbcf },
2229
{ path = "LICENSE-APACHE", hash = 0x24b54f4b },
2330
{ path = "LICENSE-MIT", hash = 0x462dee44 },
24-
{ path = "src/unicode/data/LICENSE-UNICODE", hash = 0x70f7339 },
2531
]
2632

2733
[clarify.crossbeam-channel]
@@ -58,12 +64,16 @@ license-files = [
5864
{ path = "src/unicode_tables/LICENSE-UNICODE", hash = 0xa7f28b93 },
5965
]
6066

61-
[clarify.unicode-ident]
62-
expression = "(MIT OR Apache-2.0) AND Unicode-DFS-2016"
67+
[clarify.spdx]
68+
expression = "MIT OR Apache-2.0"
6369
license-files = [
64-
{ path = "LICENSE-APACHE", hash = 0xb5518783 },
65-
{ path = "LICENSE-MIT", hash = 0x386ca1bc },
66-
{ path = "LICENSE-UNICODE", hash = 0x9698cbbe },
70+
{ path = "LICENSE-MIT", hash = 0xa502ee8a },
71+
{ path = "LICENSE-APACHE", hash = 0x4fccb6b7 },
72+
]
73+
skip-dirs = [
74+
# The spdx crate contains the full text of referred licenses
75+
"src/text/licenses",
76+
"src/text/exceptions",
6777
]
6878

6979
[clarify.zstd-safe]

0 commit comments

Comments
 (0)