Skip to content

Commit

Permalink
Add new license detection rules (#3575)
Browse files Browse the repository at this point in the history
* Add new license detection rules

Also add trailing LF to license rule texts

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Co-authored-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
  • Loading branch information
pombredanne and AyanSinhaMahapatra authored Nov 9, 2023
1 parent 1163957 commit 1c4d6be
Show file tree
Hide file tree
Showing 40 changed files with 335 additions and 69 deletions.
2 changes: 1 addition & 1 deletion etc/scripts/licenses/buildrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RuleData(object):

def __attrs_post_init__(self, *args, **kwargs):
self.raw_data = rdat = "\n".join(self.data_lines).strip()
self.text = "\n".join(self.text_lines).strip()
self.text = "\n".join(self.text_lines).strip() + "\n"

# validate YAML syntax
try:
Expand Down
7 changes: 7 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_1316.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
license_expression: apache-2.0
is_license_tag: yes
relevance: 100
---

name: The Apache Software License, Version 2.0
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_1317.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: apache-2.0
is_license_tag: yes
relevance: 100
ignorable_urls:
- http://www.apache.org/license/LICENSE-2.0.txt
---

url: http://www.apache.org/license/LICENSE-2.0.txt
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_1318.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: apache-2.0
is_license_reference: yes
relevance: 100
ignorable_urls:
- http://www.apache.org/license/LICENSE-2.0.txt
---

http://www.apache.org/license/LICENSE-2.0.txt
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/authorizenet-sdk_3.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: authorizenet-sdk
is_license_tag: yes
ignorable_urls:
- https://github.com/AuthorizeNet/sdk-java/blob/master/LICENSE.txt
---

name: SDK License Agreement
url: {{https://github.com/AuthorizeNet/sdk-java/blob/master/LICENSE.txt}}
10 changes: 10 additions & 0 deletions src/licensedcode/data/rules/bsd-new_1346.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
license_expression: bsd-new
is_license_tag: yes
ignorable_urls:
- http://www.linfo.org/bsdlicense.html
---

name: BSD
url: http://www.linfo.org/bsdlicense.html
comments: Free for open or commercial use, with credit line
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/epl-2.0_76.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: epl-2.0
is_license_tag: yes
ignorable_urls:
- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
---

- name: Eclipse Public License v. 2.0
url: https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
10 changes: 10 additions & 0 deletions src/licensedcode/data/rules/epl-2.0_77.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
license_expression: epl-2.0
is_license_tag: yes
ignorable_urls:
- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
---

license
<name>Eclipse Public License v. 2.0
<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
license_expression: epl-2.0 OR gpl-2.0 WITH classpath-exception-2.0
is_license_tag: yes
ignorable_urls:
- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
- https://www.gnu.org/software/classpath/license.html
---

<name>Eclipse Public License v. 2.0</name>
<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
<name>GNU General Public License, version 2 with the GNU Classpath Exception</name>
<url>https://www.gnu.org/software/classpath/license.html</url>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
license_expression: epl-2.0 OR gpl-2.0 WITH classpath-exception-2.0
is_license_tag: yes
ignorable_urls:
- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
- https://www.gnu.org/software/classpath/license.html
---

license
<name>Eclipse Public License v. 2.0</name>
<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
<name>GNU General Public License, version 2 with the GNU Classpath Exception</name>
<url>https://www.gnu.org/software/classpath/license.html</url>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
license_expression: epl-2.0 OR gpl-2.0 WITH classpath-exception-2.0
is_license_tag: yes
ignorable_urls:
- https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
- https://www.gnu.org/software/classpath/license.html
---

license
<name>Eclipse Public License v. 2.0
<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
<name>GNU General Public License, version 2 with the GNU Classpath Exception
<url>https://www.gnu.org/software/classpath/license.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: gpl-2.0 WITH classpath-exception-2.0
is_license_tag: yes
ignorable_urls:
- https://www.gnu.org/software/classpath/license.html
---

- name: GNU General Public License, version 2 with the GNU Classpath Exception
url: https://www.gnu.org/software/classpath/license.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
license_expression: gpl-2.0 WITH classpath-exception-2.0
is_license_tag: yes
ignorable_urls:
- https://www.gnu.org/software/classpath/license.html
---

license
<name>GNU General Public License, version 2 with the GNU Classpath Exception
<url>https://www.gnu.org/software/classpath/license.html
12 changes: 12 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_320.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
license_expression: lgpl-3.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
---

<license>
<name>GNU General Lesser Public License (LGPL) version 3.0</name>
<url>http://www.gnu.org/licenses/lgpl.html</url>
<distribution>repo</distribution>
</license>
9 changes: 9 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_321.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
license_expression: lgpl-3.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
---

- name: GNU General Lesser Public License (LGPL) version 3.0
url: http://www.gnu.org/licenses/lgpl.html
13 changes: 13 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_or_mpl-2.0_1.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
license_expression: lgpl-3.0 OR mpl-2.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
- http://www.mozilla.org/MPL/2.0/
---

license
- name: GNU General Lesser Public License (LGPL) version 3.0
url: http://www.gnu.org/licenses/lgpl.html
- name: Mozilla Public License Version 2.0
url: http://www.mozilla.org/MPL/2.0/
14 changes: 14 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_or_mpl-2.0_2.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
license_expression: lgpl-3.0 OR mpl-2.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
- http://www.mozilla.org/MPL/2.0/
---

license
- name: GNU General Lesser Public License (LGPL) version 3.0
url: http://www.gnu.org/licenses/lgpl.html
- name: Mozilla Public License Version 2.0
url: http://www.mozilla.org/MPL/2.0/
license
15 changes: 15 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_or_mpl-2.0_3.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
license_expression: lgpl-3.0 OR mpl-2.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
- http://www.mozilla.org/MPL/2.0/
---

licenses
license
- name: GNU General Lesser Public License (LGPL) version 3.0
url: http://www.gnu.org/licenses/lgpl.html
- name: Mozilla Public License Version 2.0
url: http://www.mozilla.org/MPL/2.0/
license
18 changes: 18 additions & 0 deletions src/licensedcode/data/rules/lgpl-3.0_or_mpl-2.0_4.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
license_expression: lgpl-3.0 OR mpl-2.0
is_license_tag: yes
ignorable_urls:
- http://www.gnu.org/licenses/lgpl.html
- http://www.mozilla.org/MPL/2.0/
---

<license>
<name>GNU General Lesser Public License (LGPL) version 3.0</name>
<url>http://www.gnu.org/licenses/lgpl.html</url>
<distribution>repo</distribution>
</license>
<license>
<name>Mozilla Public License Version 2.0</name>
<url>http://www.mozilla.org/MPL/2.0/</url>
<distribution>repo</distribution>
</license>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
license_expression: authorizenet-sdk
is_license_clue: yes
is_continuous: yes
relevance: 70
---

{{AuthorizeNet sdk license}}
12 changes: 12 additions & 0 deletions src/licensedcode/data/rules/mpl-2.0_139.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
license_expression: mpl-2.0
is_license_tag: yes
ignorable_urls:
- http://www.mozilla.org/MPL/2.0/
---

<license>
<name>Mozilla Public License Version 2.0</name>
<url>http://www.mozilla.org/MPL/2.0/</url>
<distribution>repo</distribution>
</license>
10 changes: 10 additions & 0 deletions src/licensedcode/data/rules/mpl-2.0_140.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
license_expression: mpl-2.0
is_license_tag: yes
relevance: 100
ignorable_urls:
- http://www.mozilla.org/MPL/2.0/
---

- name: Mozilla Public License Version 2.0
url: http://www.mozilla.org/MPL/2.0/
16 changes: 16 additions & 0 deletions src/licensedcode/data/rules/other-permissive_425.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
license_expression: other-permissive
is_license_notice: yes
minimum_coverage: 95
notes: Seen in openpdf See also https://web.archive.org/web/20060113033212/http://www.javaworld.com/javaworld/javatips/jw-javatip128.html
ignorable_urls:
- http://www.javaworld.com/javaworld/javatips/jw-javatip128.html
---

SimpleXMLParser:
The original version of this class was published in a JavaWorld article by Steven Brandt:
http://www.javaworld.com/javaworld/javatips/jw-javatip128.html
Jennifer Orr (JavaWorld) wrote: "You have permission to use the code appearing in
Steven Brandt's JavaWorld article, 'Java Tip 128: Create a quick-and-dirty XML parser.'
We ask that you reference the author as the creator and JavaWorld as the original publisher
of the code." Steven Brandt also agreed with the use of this class.
18 changes: 18 additions & 0 deletions src/licensedcode/data/rules/other-permissive_426.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
license_expression: other-permissive
is_license_text: yes
notes: Similar to hpnd-sell-variant-mit-disclaimer and seen in https://gitlab.freedesktop.org/xorg/xserver/-/blob/141e7dd8a373eafe28fb4f6433671979fb4c59a7/COPYING#L1781
---

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
this permission notice appear in supporting documentation. This permission
notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
license_expressions:
- other-permissive
- bsd-3-clause-no-nuclear-warranty
- bsd-3-clause-no-nuclear-warranty
- x11-tiff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@
"score": 100.0,
"start_line": 1,
"end_line": 1,
"matched_length": 7,
"matched_length": 8,
"match_coverage": 100.0,
"matcher": "2-aho",
"license_expression": "apache-2.0",
"rule_identifier": "apache-2.0_5.RULE",
"rule_identifier": "apache-2.0_1316.RULE",
"rule_relevance": 100,
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_5.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1316.RULE",
"matched_text": "- name: The Apache Software License, Version 2.0"
}
],
"identifier": "apache_2_0-daaaee76-1395-c8c8-e06a-3f3f76e079b1"
"identifier": "apache_2_0-c3b9cbd8-09fc-8aa5-f48b-917b9001c088"
}
],
"other_license_expression": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,17 +698,17 @@
"score": 100.0,
"start_line": 1,
"end_line": 1,
"matched_length": 7,
"matched_length": 8,
"match_coverage": 100.0,
"matcher": "2-aho",
"license_expression": "apache-2.0",
"rule_identifier": "apache-2.0_5.RULE",
"rule_identifier": "apache-2.0_1316.RULE",
"rule_relevance": 100,
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_5.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1316.RULE",
"matched_text": "- name: The Apache Software License, Version 2.0"
}
],
"identifier": "apache_2_0-daaaee76-1395-c8c8-e06a-3f3f76e079b1"
"identifier": "apache_2_0-c3b9cbd8-09fc-8aa5-f48b-917b9001c088"
}
],
"other_license_expression": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@
"score": 100.0,
"start_line": 1,
"end_line": 1,
"matched_length": 7,
"matched_length": 8,
"match_coverage": 100.0,
"matcher": "2-aho",
"license_expression": "apache-2.0",
"rule_identifier": "apache-2.0_5.RULE",
"rule_identifier": "apache-2.0_1316.RULE",
"rule_relevance": 100,
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_5.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1316.RULE",
"matched_text": "- name: The Apache Software License, Version 2.0"
}
],
"identifier": "apache_2_0-daaaee76-1395-c8c8-e06a-3f3f76e079b1"
"identifier": "apache_2_0-c3b9cbd8-09fc-8aa5-f48b-917b9001c088"
}
],
"other_license_expression": null,
Expand Down
Loading

0 comments on commit 1c4d6be

Please sign in to comment.