license_finder 7.0.1 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +7 -0
  3. data/.pre-commit-hooks.yaml +10 -0
  4. data/.rubocop.yml +5 -1
  5. data/CHANGELOG.md +41 -0
  6. data/CONTRIBUTING.md +1 -0
  7. data/Dockerfile +129 -122
  8. data/README.md +53 -14
  9. data/Rakefile +1 -1
  10. data/VERSION +1 -1
  11. data/ci/pipelines/pull-request.yml.erb +29 -32
  12. data/ci/pipelines/release.yml.erb +17 -41
  13. data/ci/scripts/run-tests.sh +20 -4
  14. data/ci/tasks/rubocop.yml +3 -3
  15. data/ci/tasks/update-changelog.yml +2 -2
  16. data/dlf +6 -1
  17. data/lib/license_finder/cli/base.rb +2 -0
  18. data/lib/license_finder/cli/licenses.rb +8 -3
  19. data/lib/license_finder/cli/main.rb +3 -1
  20. data/lib/license_finder/configuration.rb +8 -0
  21. data/lib/license_finder/core.rb +4 -2
  22. data/lib/license_finder/decision_applier.rb +1 -1
  23. data/lib/license_finder/decisions.rb +24 -6
  24. data/lib/license_finder/license/definitions.rb +129 -19
  25. data/lib/license_finder/license/templates/AGPL3.txt +661 -0
  26. data/lib/license_finder/license/templates/Apache2.txt +0 -2
  27. data/lib/license_finder/license/templates/Artistic.txt +128 -0
  28. data/lib/license_finder/license/templates/CC01_alt.txt +31 -0
  29. data/lib/license_finder/license/templates/CDDL1_1.txt +123 -0
  30. data/lib/license_finder/license/templates/CPL1.txt +217 -0
  31. data/lib/license_finder/license/templates/EPL2.txt +80 -0
  32. data/lib/license_finder/license/templates/Unlicense.txt +24 -0
  33. data/lib/license_finder/license/text.rb +4 -0
  34. data/lib/license_finder/license.rb +1 -1
  35. data/lib/license_finder/manual_licenses.rb +79 -0
  36. data/lib/license_finder/package.rb +1 -0
  37. data/lib/license_finder/package_manager.rb +2 -1
  38. data/lib/license_finder/package_managers/cargo.rb +1 -1
  39. data/lib/license_finder/package_managers/conan.rb +50 -8
  40. data/lib/license_finder/package_managers/dep.rb +43 -41
  41. data/lib/license_finder/package_managers/dotnet.rb +5 -2
  42. data/lib/license_finder/package_managers/go_dep.rb +1 -1
  43. data/lib/license_finder/package_managers/go_workspace.rb +3 -2
  44. data/lib/license_finder/package_managers/maven.rb +18 -10
  45. data/lib/license_finder/package_managers/npm.rb +14 -1
  46. data/lib/license_finder/package_managers/nuget.rb +5 -0
  47. data/lib/license_finder/package_managers/pip.rb +1 -1
  48. data/lib/license_finder/package_managers/pnpm.rb +126 -0
  49. data/lib/license_finder/package_managers/yarn.rb +69 -20
  50. data/lib/license_finder/package_utils/conan_info_parser.rb +2 -2
  51. data/lib/license_finder/package_utils/conan_info_parser_v2.rb +82 -0
  52. data/lib/license_finder/package_utils/license_files.rb +12 -2
  53. data/lib/license_finder/package_utils/licensing.rb +2 -1
  54. data/lib/license_finder/package_utils/maven_dependency_finder.rb +43 -1
  55. data/lib/license_finder/package_utils/notice_files.rb +14 -3
  56. data/lib/license_finder/package_utils/possible_license_file.rb +8 -2
  57. data/lib/license_finder/package_utils/pypi.rb +3 -1
  58. data/lib/license_finder/packages/maven_package.rb +13 -1
  59. data/lib/license_finder/packages/npm_package.rb +56 -9
  60. data/lib/license_finder/packages/pnpm_package.rb +13 -0
  61. data/lib/license_finder/printer.rb +2 -2
  62. data/lib/license_finder/reports/csv_report.rb +10 -1
  63. data/lib/license_finder/scanner.rb +3 -3
  64. data/license_finder.gemspec +12 -11
  65. metadata +54 -28
@@ -7,12 +7,17 @@ module LicenseFinder
7
7
 
8
8
  def all
9
9
  [
10
+ agpl3,
10
11
  apache1_1,
11
12
  apache2,
13
+ artistic,
12
14
  bsd,
13
15
  cc01,
14
16
  cddl1,
17
+ cddl1_1,
18
+ cpl1,
15
19
  eclipse1,
20
+ eclipse2,
16
21
  gplv2,
17
22
  gplv3,
18
23
  isc,
@@ -26,6 +31,7 @@ module LicenseFinder
26
31
  python,
27
32
  ruby,
28
33
  simplifiedbsd,
34
+ unlicense,
29
35
  wtfpl,
30
36
  zerobsd,
31
37
  zlib
@@ -42,14 +48,39 @@ module LicenseFinder
42
48
 
43
49
  private
44
50
 
51
+ def agpl3
52
+ License.new(
53
+ short_name: 'AGPL3',
54
+ spdx_id: 'AGPL-3.0-only',
55
+ pretty_name: 'GNU Affero GPL',
56
+ other_names: [
57
+ 'AGPL 3',
58
+ 'AGPL-3.0',
59
+ 'AGPL 3.0',
60
+ 'GNU Affero General Public License v3.0',
61
+ 'GNU Affero General Public License, Version 3'
62
+ ],
63
+ url: 'http://www.gnu.org/licenses/agpl-3.0.html'
64
+ )
65
+ end
66
+
45
67
  def apache1_1
46
68
  License.new(
47
69
  short_name: 'Apache1_1',
48
- pretty_name: 'Apache 1.1',
49
70
  spdx_id: 'Apache-1.1',
71
+ pretty_name: 'Apache 1.1',
50
72
  other_names: [
73
+ 'Apache',
51
74
  'Apache-1.1',
52
- 'The Apache Software License, Version 1.1'
75
+ 'APACHE 1.1',
76
+ 'Apache License 1.1',
77
+ 'Apache License Version 1.1',
78
+ 'Apache Public License 1.1',
79
+ 'Apache Software License, Version 1.1',
80
+ 'Apache Software License - Version 1.1',
81
+ 'Apache License, Version 1.1',
82
+ 'ASL 1.1',
83
+ 'ASF 1.1'
53
84
  ],
54
85
  url: 'http://www.apache.org/licenses/LICENSE-1.1.txt'
55
86
  )
@@ -58,10 +89,9 @@ module LicenseFinder
58
89
  def apache2
59
90
  License.new(
60
91
  short_name: 'Apache2',
61
- pretty_name: 'Apache 2.0',
62
92
  spdx_id: 'Apache-2.0',
93
+ pretty_name: 'Apache 2.0',
63
94
  other_names: [
64
- 'Apache-2.0',
65
95
  'Apache Software License',
66
96
  'Apache License 2.0',
67
97
  'Apache License Version 2.0',
@@ -78,12 +108,22 @@ module LicenseFinder
78
108
  )
79
109
  end
80
110
 
111
+ def artistic
112
+ License.new(
113
+ short_name: 'Artistic',
114
+ spdx_id: 'Artistic-1.0',
115
+ pretty_name: 'Artistic 1.0',
116
+ other_names: ['Artistic License'],
117
+ url: 'https://www.perlfoundation.org/artistic-license-20.html'
118
+ )
119
+ end
120
+
81
121
  def bsd
82
122
  License.new(
83
123
  short_name: 'BSD',
84
124
  spdx_id: 'BSD-4-Clause',
85
- other_names: ['BSD4', 'bsd-old', '4-clause BSD', 'BSD-4-Clause', 'BSD 4-Clause', 'BSD License'],
86
- url: 'http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29'
125
+ other_names: ['BSD4', 'bsd-old', '4-clause BSD', 'BSD 4-Clause', 'BSD License'],
126
+ url: 'https://directory.fsf.org/wiki/License:BSD-4-Clause'
87
127
  )
88
128
  end
89
129
 
@@ -93,6 +133,10 @@ module LicenseFinder
93
133
  spdx_id: 'CC0-1.0',
94
134
  pretty_name: 'CC0 1.0 Universal',
95
135
  other_names: ['CC0 1.0'],
136
+ matcher: AnyMatcher.new(
137
+ Matcher.from_template(Template.named('CC01')),
138
+ Matcher.from_template(Template.named('CC01_alt'))
139
+ ),
96
140
  url: 'http://creativecommons.org/publicdomain/zero/1.0'
97
141
  )
98
142
  end
@@ -111,25 +155,75 @@ module LicenseFinder
111
155
  )
112
156
  end
113
157
 
158
+ def cddl1_1
159
+ License.new(
160
+ short_name: 'CDDL1_1',
161
+ spdx_id: 'CDDL-1.1',
162
+ pretty_name: 'Common Development and Distribution License 1.1',
163
+ other_names: [
164
+ 'CDDL-1.1',
165
+ 'Common Development and Distribution License (CDDL) v1.1',
166
+ 'COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.1'
167
+ ],
168
+ url: 'https://spdx.org/licenses/CDDL-1.1.html'
169
+ )
170
+ end
171
+
172
+ def cpl1
173
+ License.new(
174
+ short_name: 'CPL1',
175
+ spdx_id: 'CPL-1.0',
176
+ pretty_name: 'Common Public License Version 1.0',
177
+ other_names: [
178
+ 'CPL-1',
179
+ 'CPL 1',
180
+ 'CPL-1.0',
181
+ 'CPL 1.0',
182
+ 'Common Public License 1.0',
183
+ 'Common Public License v1.0',
184
+ 'Common Public License, v1.0'
185
+ ],
186
+ url: 'https://opensource.org/licenses/cpl1.0.txt'
187
+ )
188
+ end
189
+
114
190
  def eclipse1
115
191
  License.new(
116
192
  short_name: 'EPL1',
117
193
  spdx_id: 'EPL-1.0',
118
194
  pretty_name: 'Eclipse Public License 1.0',
119
195
  other_names: [
120
- 'EPL-1.0',
121
196
  'EPL 1.0',
197
+ 'Eclipse 1.0',
198
+ 'Eclipse Public License 1.0',
122
199
  'Eclipse Public License - v 1.0'
123
200
  ],
124
201
  url: 'https://www.eclipse.org/legal/epl-v10.html'
125
202
  )
126
203
  end
127
204
 
205
+ def eclipse2
206
+ License.new(
207
+ short_name: 'EPL2',
208
+ spdx_id: 'EPL-2.0',
209
+ pretty_name: 'Eclipse 2.0',
210
+ other_names: [
211
+ 'EPL-2.0',
212
+ 'EPL 2.0',
213
+ 'Eclipse 2.0',
214
+ 'Eclipse Public License 2.0',
215
+ 'Eclipse Public License - v 2.0'
216
+ ],
217
+ url: 'https://www.eclipse.org/legal/epl-v20.html'
218
+ )
219
+ end
220
+
128
221
  def gplv2
129
222
  License.new(
130
223
  short_name: 'GPLv2',
131
224
  spdx_id: 'GPL-2.0-only',
132
- other_names: ['GPL V2', 'gpl-v2', 'GNU GENERAL PUBLIC LICENSE Version 2'],
225
+ # pretty_name: 'GPL 2.0',
226
+ other_names: ['GPL V2', 'gpl-v2', 'GNU GENERAL PUBLIC LICENSE Version 2', 'GPL 2.0'],
133
227
  url: 'http://www.gnu.org/licenses/gpl-2.0.txt'
134
228
  )
135
229
  end
@@ -138,7 +232,8 @@ module LicenseFinder
138
232
  License.new(
139
233
  short_name: 'GPLv3',
140
234
  spdx_id: 'GPL-3.0-only',
141
- other_names: ['GPL V3', 'gpl-v3', 'GNU GENERAL PUBLIC LICENSE Version 3'],
235
+ # pretty_name: 'GPL 3.0',
236
+ other_names: ['GPL V3', 'gpl-v3', 'GNU GENERAL PUBLIC LICENSE Version 3', 'GPL 3.0'],
142
237
  url: 'http://www.gnu.org/licenses/gpl-3.0.txt'
143
238
  )
144
239
  end
@@ -147,6 +242,7 @@ module LicenseFinder
147
242
  License.new(
148
243
  short_name: 'ISC',
149
244
  spdx_id: 'ISC',
245
+ other_names: ['ISC License'],
150
246
  url: 'http://en.wikipedia.org/wiki/ISC_license'
151
247
  )
152
248
  end
@@ -155,7 +251,8 @@ module LicenseFinder
155
251
  License.new(
156
252
  short_name: 'LGPL',
157
253
  spdx_id: 'LGPL-3.0-only',
158
- other_names: ['LGPL-3', 'LGPLv3', 'LGPL-3.0'],
254
+ # pretty_name: 'LGPL 3.0',
255
+ other_names: ['LGPL-3', 'LGPLv3', 'LGPL-3.0', 'LGPL 3.0'],
159
256
  url: 'http://www.gnu.org/licenses/lgpl.txt'
160
257
  )
161
258
  end
@@ -166,12 +263,11 @@ module LicenseFinder
166
263
  spdx_id: 'LGPL-2.1-only',
167
264
  pretty_name: 'GNU Lesser General Public License version 2.1',
168
265
  other_names: [
169
- 'LGPL-2.1-only',
170
266
  'LGPL 2.1',
171
267
  'LGPL v2.1',
172
268
  'GNU Lesser General Public License 2.1'
173
269
  ],
174
- url: 'https://opensource.org/licenses/LGPL-2.1'
270
+ url: 'https://www.gnu.org/licenses/lgpl-2.1.txt'
175
271
  )
176
272
  end
177
273
 
@@ -190,7 +286,7 @@ module LicenseFinder
190
286
  License.new(
191
287
  short_name: 'MIT',
192
288
  spdx_id: 'MIT',
193
- other_names: ['Expat', 'MIT license', 'MIT License', 'The MIT License (MIT)'],
289
+ other_names: ['Expat', 'MIT license', 'MIT License (MIT)'],
194
290
  url: 'http://opensource.org/licenses/mit-license',
195
291
  matcher: matcher
196
292
  )
@@ -213,6 +309,7 @@ module LicenseFinder
213
309
  pretty_name: 'Mozilla Public License 1.1',
214
310
  other_names: [
215
311
  'MPL-1.1',
312
+ 'Mozilla 1.1',
216
313
  'Mozilla Public License, Version 1.1',
217
314
  'Mozilla Public License version 1.1'
218
315
  ],
@@ -222,7 +319,7 @@ module LicenseFinder
222
319
  end
223
320
 
224
321
  def mpl2
225
- header_regexp = /Mozilla Public Licen[sc]e, version 2\.0/
322
+ header_regexp = /Mozilla Public Licen[sc]e.*version 2\.0/
226
323
 
227
324
  matcher = AnyMatcher.new(
228
325
  Matcher.from_template(Template.named('MPL2')),
@@ -235,6 +332,7 @@ module LicenseFinder
235
332
  pretty_name: 'Mozilla Public License 2.0',
236
333
  other_names: [
237
334
  'MPL-2.0',
335
+ 'Mozilla 2.0',
238
336
  'Mozilla Public License, Version 2.0',
239
337
  'Mozilla Public License version 2.0'
240
338
  ],
@@ -265,12 +363,13 @@ module LicenseFinder
265
363
  'BSD 3',
266
364
  'BSD-3',
267
365
  '3-clause BSD',
268
- 'BSD-3-Clause',
366
+ '3-Clause BSD License',
367
+ 'BSD 3-Clause',
269
368
  'BSD 3-Clause License',
270
- 'The 3-Clause BSD License',
271
369
  'BSD 3-clause New License',
272
370
  'New BSD License',
273
371
  'BSD New license',
372
+ 'BSD License 3',
274
373
  'BSD Licence 3'
275
374
  ],
276
375
  url: 'http://opensource.org/licenses/BSD-3-Clause',
@@ -297,8 +396,11 @@ module LicenseFinder
297
396
  pretty_name: 'Python Software Foundation License',
298
397
  other_names: [
299
398
  'PSF',
399
+ 'PSF 2.0',
300
400
  'PSFL',
301
- 'PSF License'
401
+ 'Python 2.0',
402
+ 'PSF License',
403
+ 'PSF License 2.0'
302
404
  ],
303
405
  url: 'http://hg.python.org/cpython/raw-file/89ce323357db/LICENSE'
304
406
  )
@@ -329,14 +431,22 @@ module LicenseFinder
329
431
  other_names: [
330
432
  'FreeBSD',
331
433
  '2-clause BSD',
332
- 'BSD-2-Clause',
333
434
  'BSD 2-Clause',
334
- 'The BSD 2-Clause License'
435
+ 'BSD 2-Clause License'
335
436
  ],
336
437
  url: 'http://opensource.org/licenses/bsd-license'
337
438
  )
338
439
  end
339
440
 
441
+ def unlicense
442
+ License.new(
443
+ short_name: 'Unlicense',
444
+ spdx_id: 'Unlicense',
445
+ pretty_name: 'The Unlicense',
446
+ url: 'https://unlicense.org/'
447
+ )
448
+ end
449
+
340
450
  def wtfpl
341
451
  License.new(
342
452
  short_name: 'WTFPL',