Skip to content

Commit 61275cc

Browse files
authored
Add fsf-free and osi-approved options (#250)
1 parent d1a97df commit 61275cc

File tree

193 files changed

+6004
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+6004
-16
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,22 @@ Note: License-Eye may query the RubyGems API to determine licenses when they are
173173
174174
</details>
175175
176+
### Global CLI flags
177+
178+
The following flags are available for all commands:
179+
180+
| Flag name | Short name | Description |
181+
|---------------|------------|-----------------------------------------------------------------------|
182+
| `--verbosity` | `-v` | Set log level (debug, info, warn, error, fatal, panic). Default: info |
183+
| `--config` | `-c` | Path to the configuration file. Default: .licenserc.yaml |
184+
185+
Examples:
186+
187+
```bash
188+
license-eye --verbosity debug --config .licenserc.yaml header check
189+
license-eye -v warn -c path/to/.licenserc.yaml dep resolve
190+
```
191+
176192
### Docker Image
177193

178194
For Bash, users can execute the following command,
@@ -296,7 +312,7 @@ INFO Totally checked 20 files, valid: 10, invalid: 10, ignored: 0, fixed: 10
296312

297313
This command assists human audits of the dependencies licenses. It's exit code is always 0.
298314

299-
It supports two flags:
315+
It supports three flags, in addition to the [global](#global-cli-flags) ones:
300316

301317
| Flag name | Short name | Description |
302318
|-------------|------------|----------------------------------------------------------------------------------------------------------------------------------------|
@@ -672,6 +688,20 @@ the command will exit with status code 1 and fail the command.
672688
license-eye -c test/testdata/.licenserc_for_test_check.yaml dep check
673689
```
674690

691+
It supports three flags, in addition to the [global](#global-cli-flags) ones:
692+
693+
| Flag name | Short name | Description |
694+
|---------------------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
695+
| `--weak-compatible` | `-w` | Treat weak-compatible licenses as compatible during checks. Use with caution and manually confirm the usage conditions for such licenses are met. |
696+
| `--fsf-free` | `-f` | Only consider licenses marked as FSF Free/Libre when determining compatibility. Non‑FSF‑free licenses are treated as incompatible. |
697+
| `--osi-approved` | `-o` | Only consider OSI‑approved licenses when determining compatibility. Non‑OSI‑approved licenses are treated as incompatible. |
698+
699+
Example using weak-compatible mode:
700+
701+
```bash
702+
license-eye -c test/testdata/.licenserc_for_test_check.yaml dep check -w
703+
```
704+
675705
<details>
676706
<summary>Dependency Check Result</summary>
677707

@@ -779,6 +809,8 @@ dependency: # <16>
779809
version: dependency-version # <20>
780810
license: Apache-2.0 # <21>
781811
threshold: 75 # <22>
812+
require_fsf_free: false # <26>
813+
require_osi_approved: false # <27>
782814
excludes: # <23>
783815
- name: dependency-name # the same format as <19>
784816
version: dependency-version # the same format as <20>
@@ -819,6 +851,8 @@ header:
819851
23. The dependencies that should be excluded when analyzing the licenses, this is useful when you declare the dependencies in `pom.xml` with `compile` scope but don't distribute them in package. (Note that non-`compile` scope dependencies are automatically excluded so you don't need to put them here).
820852
24. The transitive dependencies brought by <23> should be recursively excluded when analyzing the licenses, currently only maven project supports this.
821853
25. The copyright year of the work, if it's empty, it will be set to the current year. If you don't want to update the license year anually, you can set this to the year of the first publication of your work, such as `1994`, or `1994-2023`.
854+
26. When `require_fsf_free` is true, only dependency licenses marked as FSF Free/Libre in the built-in compatibility matrices are considered compatible. Licenses not marked FSF-free will be treated as incompatible even if otherwise listed as compatible. This can also be enabled via the CLI flag `--fsf-free` (`-f`).
855+
27. When `require_osi_approved` is true, only dependency licenses marked as OSI-approved in the built-in compatibility matrices are considered compatible. Licenses not marked OSI-approved will be treated as incompatible even if otherwise listed as compatible. This can also be enabled via the CLI flag `--osi-approved` (`-o`).
822856

823857
**NOTE**: When the `SPDX-ID` is Apache-2.0 and the owner is Apache Software foundation, the content would be [a dedicated license](https://www.apache.org/legal/src-headers.html#headers) specified by the ASF, otherwise, the license would be [the standard one](https://www.apache.org/foundation/license-faq.html#Apply-My-Software).
824858

assets/compatibility/0BSD.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,6 @@ weak-compatible:
7878
- OSL-3.0
7979
- Ruby
8080
- SPL-1.0
81+
82+
fsf-free: true
83+
osi-approved: true

assets/compatibility/AAL.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AAL license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AAL.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: false
39+
osi-approved: true

assets/compatibility/AFL-1.1.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AFL-1.1 license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AFL-1.1.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true

assets/compatibility/AFL-1.2.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AFL-1.2 license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AFL-1.2.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true

assets/compatibility/AFL-2.0.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AFL-2.0 license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AFL-2.0.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true

assets/compatibility/AFL-2.1.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AFL-2.1 license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AFL-2.1.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true

assets/compatibility/AFL-3.0.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,6 @@ weak-compatible:
7878
- OSL-3.0
7979
- Ruby
8080
- SPL-1.0
81+
82+
fsf-free: true
83+
osi-approved: true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AGPL-3.0-only license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AGPL-3.0-only.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Compatibility matrix derived from:
19+
# https://www.apache.org/legal/resolved.html
20+
# Category A (permissive) licenses are compatible with each other.
21+
# Category A (permissive) licenses are weak-compatible with Category B (weak copyleft).
22+
# Category B (weak copyleft) licenses are weak-compatible with Category A (permissive).
23+
# Category B (weak copyleft) licenses are compatible with each other.
24+
25+
# Compatibility matrix for the AGPL-3.0-or-later license.
26+
# Category: Neither Category A nor Category B
27+
# SPDX: https://spdx.org/licenses/AGPL-3.0-or-later.html
28+
29+
compatible:
30+
- Unknown
31+
32+
incompatible:
33+
- Unknown
34+
35+
weak-compatible:
36+
- Unknown
37+
38+
fsf-free: true
39+
osi-approved: true

0 commit comments

Comments
 (0)