Skip to content

Commit

Permalink
Add improved license rules #1281
Browse files Browse the repository at this point in the history
 * improve detection based on SignalR repos scans with new rules and/or
   adding or updating the rule "relevance" as needed

Reported-by: Jonas Öberg @jonasob
Signed-off-by: Philippe Ombredanne <[email protected]>
  • Loading branch information
pombredanne committed Nov 13, 2018
1 parent 71a0095 commit c588ec1
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/licensedcode/data/rules/apache-2.0_125.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Licensed under the Apache License, Version 2.0. See License.txt in t
4 changes: 4 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_125.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
license_expression: apache-2.0
is_license_reference: yes
relevance: 100
referenced_filename: License.txt
15 changes: 15 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_126.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Apache 2.0 License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
2 changes: 2 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_126.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license_expression: apache-2.0
is_license_notice: yes
12 changes: 12 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_1.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NUGET: BEGIN LICENSE TEXT

Microsoft grants you the right to use these script files for the sole
purpose of either: (i) interacting through your browser with the Microsoft
website or online service, subject to the applicable licensing or use
terms; or (ii) using the files as included with a Microsoft product subject
to that product's license terms. Microsoft reserves all other rights to the
files not expressly granted by Microsoft, whether by implication, estoppel
or otherwise. Insofar as a script file is dual licensed under GPL,
Microsoft neither took the code under GPL nor distributes it thereunder but
under the terms set out in this paragraph. All notices and licenses
below are for informational purposes only.
2 changes: 2 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license_expression: ms-nuget
is_license_text: yes
11 changes: 11 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_2.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Microsoft grants you the right to use these script files for the sole
purpose of either: (i) interacting through your browser with the Microsoft
website or online service, subject to the applicable licensing or use
terms; or (ii) using the files as included with a Microsoft product subject
to that product's license terms. Microsoft reserves all other rights to the
files not expressly granted by Microsoft, whether by implication, estoppel
or otherwise. Insofar as a script file is dual licensed under GPL,
Microsoft neither took the code under GPL nor distributes it thereunder but
under the terms set out in this paragraph. All notices and licenses
below are for informational purposes only.

2 changes: 2 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license_expression: ms-nuget
is_license_text: yes
18 changes: 18 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_and_mit_1.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
NUGET: BEGIN LICENSE TEXT

Microsoft grants you the right to use these script files for the sole
purpose of either: (i) interacting through your browser with the Microsoft
website or online service, subject to the applicable licensing or use
terms; or (ii) using the files as included with a Microsoft product subject
to that product's license terms. Microsoft reserves all other rights to the
files not expressly granted by Microsoft, whether by implication, estoppel
or otherwise. Insofar as a script file is dual licensed under GPL,
Microsoft neither took the code under GPL nor distributes it thereunder but
under the terms set out in this paragraph. All notices and licenses
below are for informational purposes only.

http://jquery.org/license
http://opensource.org/licenses/MIT

NUGET: END LICENSE TEXT */
! jquery.org/license
3 changes: 3 additions & 0 deletions src/licensedcode/data/rules/ms-nuget_and_mit_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
license_expression: ms-nuget AND mit AND mit
is_license_notice: yes
minimum_coverage: 93
10 changes: 5 additions & 5 deletions tests/formattedcode/data/csv/livescan/expected.csv
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Resource,type,name,base_name,extension,size,date,sha1,md5,mime_type,file_type,programming_language,is_binary,is_text,is_archive,is_media,is_source,is_script,files_count,dirs_count,size_count,scan_errors,license_expression,license__key,license__score,license__name,license__short_name,license__category,license__is_exception,license__owner,license__homepage_url,license__text_url,license__reference_url,license__spdx_license_key,license__spdx_url,start_line,end_line,matched_rule__identifier,matched_rule__license_expression,matched_rule__licenses,matched_rule__is_license_text,matched_rule__is_license_notice,matched_rule__is_license_reference,matched_rule__is_license_tag,copyright,copyright_holder,email,url,package__type,package__namespace,package__name,package__version,package__qualifiers,package__subpath,package__primary_language,package__description,package__size,package__release_date,package__homepage_url,package__download_url,package__download_sha1,package__download_md5,package__download_sha256,package__download_sha512,package__bug_tracking_url,package__code_view_url,package__vcs_tool,package__vcs_repository,package__vcs_revision,package__copyright,package__license_expression,package__declared_license,package__notice_text,package__manifest_path,package__contains_source_code,package__source_packages,package__purl,package__repository_homepage_url,package__repository_download_url,package__api_data_url
/json2csv.rb,file,json2csv.rb,json2csv,.rb,1014,2017-12-04,92a83e5f8566bee7c83cf798c1b8912d609f56e0,380b7a5f483db7ace853b8f9dca5bfec,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,file,json2csv.rb,json2csv,.rb,912,2018-11-13,1236469a06a2bacbdd8e172ad718482af5b0a936,1307c281e0b153202e291b217eab85d5,text/x-python,"Python script, ASCII text executable",Ruby,False,True,False,False,True,True,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,apache-2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,apache-2.0,89.54,Apache License 2.0,Apache 2.0,Permissive,False,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,14,apache-2.0_7.RULE,apache-2.0,[u'apache-2.0'],False,True,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,apache-2.0,100.00,Apache License 2.0,Apache 2.0,Permissive,False,Apache Software Foundation,http://www.apache.org/licenses/,http://www.apache.org/licenses/LICENSE-2.0,https://enterprise.dejacode.com/urn/urn:dje:license:apache-2.0,Apache-2.0,https://spdx.org/licenses/Apache-2.0,5,13,apache-2.0_7.RULE,apache-2.0,[u'apache-2.0'],False,True,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,Copyright (c) 2017 nexB Inc. and others.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,3,,,,,,,,,nexB Inc. and others.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,http://nexb.com/,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,,,,,,,,,,,https://github.com/nexB/scancode-toolkit/,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10,,,,,,,,,,,http://apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/license,file,license,license,,679,2017-12-04,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/json2csv.rb,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,8,,,,,,,,,,,http://www.apache.org/licenses/LICENSE-2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/license,file,license,license,,679,2018-04-11,75c5490a718ddd45e40e0cc7ce0c756abc373123,b965a762efb9421cf1bf4405f336e278,text/plain,ASCII text,,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/license,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/license,,,,,,,,,,,,,,,,,,,,,,,gpl-2.0-plus,100.00,GNU General Public License 2.0 or later,GPL 2.0 or later,Copyleft,False,Free Software Foundation (FSF),http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,http://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html,https://enterprise.dejacode.com/urn/urn:dje:license:gpl-2.0-plus,GPL-2.0-or-later,https://spdx.org/licenses/GPL-2.0-or-later,1,12,gpl-2.0-plus.LICENSE,gpl-2.0-plus,[u'gpl-2.0-plus'],True,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/package.json,file,package.json,package,.json,2200,2017-12-04,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/package.json,file,package.json,package,.json,2200,2018-04-11,918376afce796ef90eeda1d6695f2289c90491ac,1f66239a9b850c5e60a9382dbe2162d2,text/plain,"ASCII text, with very long lines",,False,True,False,False,False,False,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/package.json,,,,,,,,,,,,,,,,,,,,,,mit,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/package.json,,,,,,,,,,,,,,,,,,,,,,,mit,99.40,MIT License,MIT License,Permissive,False,MIT,http://opensource.org/licenses/mit-license.php,http://opensource.org/licenses/mit-license.php,https://enterprise.dejacode.com/urn/urn:dje:license:mit,MIT,https://spdx.org/licenses/MIT,24,24,mit_31.RULE,mit,[u'mit'],True,False,False,False,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
/package.json,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,24,,,,,,,,Copyright (c) 2012 LearnBoost <[email protected]>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Expand Down
2 changes: 1 addition & 1 deletion tests/licensedcode/data/licenses/AssemblyInfoCommon.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
license_expressions:
- unknown
- unknown-license-reference

0 comments on commit c588ec1

Please sign in to comment.