license_finder 7.1.0 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -1
  3. data/CHANGELOG.md +17 -0
  4. data/Dockerfile +80 -90
  5. data/README.md +6 -7
  6. data/Rakefile +1 -1
  7. data/VERSION +1 -1
  8. data/ci/pipelines/pull-request.yml.erb +29 -32
  9. data/ci/pipelines/release.yml.erb +17 -41
  10. data/ci/scripts/run-tests.sh +20 -4
  11. data/ci/tasks/rubocop.yml +3 -3
  12. data/ci/tasks/update-changelog.yml +2 -2
  13. data/lib/license_finder/core.rb +2 -2
  14. data/lib/license_finder/license/definitions.rb +127 -19
  15. data/lib/license_finder/license/templates/AGPL3.txt +661 -0
  16. data/lib/license_finder/license/templates/Artistic.txt +128 -0
  17. data/lib/license_finder/license/templates/CC01_alt.txt +31 -0
  18. data/lib/license_finder/license/templates/CDDL1_1.txt +123 -0
  19. data/lib/license_finder/license/templates/CPL1.txt +217 -0
  20. data/lib/license_finder/license/templates/EPL2.txt +80 -0
  21. data/lib/license_finder/license/templates/Unlicense.txt +24 -0
  22. data/lib/license_finder/license/text.rb +4 -0
  23. data/lib/license_finder/license.rb +1 -1
  24. data/lib/license_finder/manual_licenses.rb +1 -1
  25. data/lib/license_finder/package_manager.rb +1 -1
  26. data/lib/license_finder/package_managers/cargo.rb +1 -1
  27. data/lib/license_finder/package_managers/conan.rb +50 -8
  28. data/lib/license_finder/package_managers/dep.rb +43 -41
  29. data/lib/license_finder/package_managers/go_dep.rb +1 -1
  30. data/lib/license_finder/package_managers/go_workspace.rb +3 -2
  31. data/lib/license_finder/package_managers/maven.rb +18 -10
  32. data/lib/license_finder/package_managers/npm.rb +14 -1
  33. data/lib/license_finder/package_managers/pip.rb +1 -1
  34. data/lib/license_finder/package_managers/pnpm.rb +7 -1
  35. data/lib/license_finder/package_managers/yarn.rb +9 -9
  36. data/lib/license_finder/package_utils/conan_info_parser.rb +2 -2
  37. data/lib/license_finder/package_utils/conan_info_parser_v2.rb +82 -0
  38. data/lib/license_finder/package_utils/license_files.rb +12 -2
  39. data/lib/license_finder/package_utils/licensing.rb +2 -1
  40. data/lib/license_finder/package_utils/maven_dependency_finder.rb +43 -1
  41. data/lib/license_finder/package_utils/notice_files.rb +14 -3
  42. data/lib/license_finder/package_utils/possible_license_file.rb +8 -2
  43. data/lib/license_finder/packages/maven_package.rb +13 -1
  44. data/lib/license_finder/packages/npm_package.rb +37 -11
  45. data/lib/license_finder/printer.rb +2 -2
  46. data/lib/license_finder/scanner.rb +3 -3
  47. data/license_finder.gemspec +11 -10
  48. metadata +44 -22
@@ -8,8 +8,8 @@ resource_types:
8
8
  source:
9
9
  repository: cfcommunity/slack-notification-resource
10
10
  tag: latest
11
- username: ((LicenseFinderDocker.username))
12
- password: ((LicenseFinderDocker.password))
11
+ username: ((license-finder-docker-username))
12
+ password: ((license-finder-docker-password))
13
13
  <% end %>
14
14
 
15
15
  resources:
@@ -17,7 +17,7 @@ resources:
17
17
  type: git
18
18
  source:
19
19
  uri: git@github.com:pivotal/LicenseFinder.git
20
- private_key: ((CfOslBot.private_key))
20
+ private_key: ((github-cf-osl-bot-private-key))
21
21
  branch: master
22
22
  ignore_paths: [VERSION, CHANGELOG.md]
23
23
 
@@ -27,24 +27,24 @@ resources:
27
27
  driver: gcs
28
28
  bucket: lf-semver-version
29
29
  key: version
30
- json_key: ((GCPQueuedReportsBucketCredentials))
30
+ json_key: ((lf-bucket-credentials))
31
31
 
32
32
  - name: dockerhub-edge
33
33
  type: docker-image
34
34
  source:
35
35
  tag: edge
36
36
  repository: licensefinder/license_finder
37
- email: ((LicenseFinderDockerEmail))
38
- username: ((LicenseFinderDocker.username))
39
- password: ((LicenseFinderDocker.password))
37
+ email: ((license-finder-docker-email))
38
+ username: ((license-finder-docker-username))
39
+ password: ((license-finder-docker-password))
40
40
 
41
41
  - name: dockerhub
42
42
  type: docker-image
43
43
  source:
44
44
  repository: licensefinder/license_finder
45
- email: ((LicenseFinderDockerEmail))
46
- username: ((LicenseFinderDocker.username))
47
- password: ((LicenseFinderDocker.password))
45
+ email: ((license-finder-docker-email))
46
+ username: ((license-finder-docker-username))
47
+ password: ((license-finder-docker-password))
48
48
 
49
49
  - name: lf-release
50
50
  type: github-release
@@ -52,7 +52,7 @@ resources:
52
52
  source:
53
53
  owner: pivotal
54
54
  repository: LicenseFinder
55
- access_token: ((GithubApiRootToken))
55
+ access_token: ((github-api-root-token))
56
56
 
57
57
  <% if setup_slack %>
58
58
  - name: slack-alert
@@ -66,10 +66,8 @@ jobs:
66
66
  public: true
67
67
  plan:
68
68
  - get: lf-git
69
- tags: ["private-worker"]
70
69
  trigger: true
71
70
  - put: dockerhub-edge
72
- tags: ["private-worker"]
73
71
  params:
74
72
  build: lf-git
75
73
 
@@ -78,16 +76,13 @@ jobs:
78
76
  public: true
79
77
  plan:
80
78
  - get: dockerhub-edge
81
- tags: ["private-worker"]
82
79
  passed: [build-docker-image]
83
80
  trigger: true
84
81
  - get: LicenseFinder
85
- tags: ["private-worker"]
86
82
  resource: lf-git
87
83
  passed: [build-docker-image]
88
84
  version: every
89
85
  - task: ruby-<%= ruby_version %>
90
- tags: ["private-worker"]
91
86
  privileged: true
92
87
  image: dockerhub-edge
93
88
  file: LicenseFinder/ci/tasks/run-tests.yml
@@ -97,7 +92,6 @@ jobs:
97
92
  <% if setup_slack %>
98
93
  on_failure:
99
94
  put: slack-alert
100
- tags: ["private-worker"]
101
95
  params:
102
96
  channel: '<%= slack_channel %>'
103
97
  icon_emoji: ':crying_cat_face:'
@@ -109,16 +103,13 @@ jobs:
109
103
  public: true
110
104
  plan:
111
105
  - get: dockerhub-edge
112
- tags: ["private-worker"]
113
106
  passed: [build-docker-image]
114
107
  trigger: true
115
108
  - get: LicenseFinder
116
- tags: ["private-worker"]
117
109
  resource: lf-git
118
110
  version: every
119
111
  passed: [build-docker-image]
120
112
  - task: run-rubocop
121
- tags: ["private-worker"]
122
113
  privileged: true
123
114
  file: LicenseFinder/ci/tasks/rubocop.yml
124
115
  input_mapping: { LicenseFinder: LicenseFinder }
@@ -126,74 +117,59 @@ jobs:
126
117
  - name: bump-major
127
118
  plan:
128
119
  - get: semver-version
129
- tags: ["private-worker"]
130
120
  params: {bump: major}
131
121
  - put: semver-version
132
- tags: ["private-worker"]
133
122
  params: {file: semver-version/version}
134
123
 
135
124
 
136
125
  - name: bump-minor
137
126
  plan:
138
127
  - get: semver-version
139
- tags: ["private-worker"]
140
128
  params: {bump: minor}
141
129
  - put: semver-version
142
- tags: ["private-worker"]
143
130
  params: {file: semver-version/version}
144
131
 
145
132
  - name: bump-patch
146
133
  plan:
147
134
  - get: semver-version
148
- tags: ["private-worker"]
149
135
  params: {bump: patch}
150
136
  - put: semver-version
151
- tags: ["private-worker"]
152
137
  params: {file: semver-version/version}
153
138
 
154
139
  - name: release
155
140
  disable_manual_trigger: true
156
141
  plan:
157
142
  - get: lf-git
158
- tags: ["private-worker"]
159
143
  passed: [<%= "#{ruby_versions.map{ |version| "ruby-#{version}" unless version == "jruby-9.3.1.0" }.compact.join(', ') }, rubocop" %>]
160
144
  - get: semver-version
161
- tags: ["private-worker"]
162
145
  trigger: true
163
146
  - get: dockerhub
164
- tags: ["private-worker"]
165
147
  params:
166
148
  save: true
167
149
  - get: lf-release
168
- tags: ["private-worker"]
169
150
  - task: update-changelog
170
- tags: ["private-worker"]
171
151
  image: dockerhub
172
152
  params:
173
- GIT_USERNAME: ((GithubApiUser))
174
- GIT_EMAIL: ((GithubApiEmail))
153
+ GIT_USERNAME: ((github-api-user))
154
+ GIT_EMAIL: ((github-api-email))
175
155
  file: lf-git/ci/tasks/update-changelog.yml
176
156
  - put: dockerhub
177
- tags: ["private-worker"]
178
157
  params:
179
158
  build: lf-git-changed
180
159
  tag: version/version.txt
181
160
  tag_as_latest: true
182
161
  - put: lf-git
183
- tags: ["private-worker"]
184
162
  params:
185
163
  repository: lf-git-changed
186
164
  - task: build-and-push-gem
187
- tags: ["private-worker"]
188
165
  image: dockerhub
189
166
  params:
190
- GIT_USERNAME: ((GithubApiUser))
191
- GIT_EMAIL: ((GithubApiEmail))
192
- GIT_PRIVATE_KEY: ((CfOslBot.private_key))
193
- GEM_API_KEY: ((LicenseFinderGemApiKey))
167
+ GIT_USERNAME: ((github-api-user))
168
+ GIT_EMAIL: ((github-api-email))
169
+ GIT_PRIVATE_KEY: ((github-cf-osl-bot-private-key))
170
+ GEM_API_KEY: ((license-finder-gem-api-key))
194
171
  file: lf-git/ci/tasks/build-and-push-gem.yml
195
172
  - put: lf-release
196
- tags: ["private-worker"]
197
173
  params:
198
174
  name: version/tag.txt
199
175
  tag: version/tag.txt
@@ -6,14 +6,30 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6
6
  PROJECT_ROOT="$( dirname "$( dirname $DIR )" )"
7
7
 
8
8
  pushd "$PROJECT_ROOT"
9
-
10
- rvm install --default $RUBY_VERSION_UNDER_TEST
9
+ DISABLE_BINARY=""
10
+ if [[ $RUBY_VERSION_UNDER_TEST == "2.6.10" ]]; then
11
+ DISABLE_BINARY="--disable-binary"
12
+ fi
13
+
14
+ # This is needed for 2.7 but also works for 2.6. For 2.6, you can also downgrade the openssl version to 1.1.1l-1ubuntu1.4 in the dockerfile with allowing downgrades for apt install -y libssl-dev=1.1.1l-1ubuntu1.4
15
+ if [[ $RUBY_VERSION_UNDER_TEST == "2.6.10" || $RUBY_VERSION_UNDER_TEST == "2.7.8" ]]; then
16
+ OPEN_SSL_FLAG="--with-openssl-dir=/usr/share/rvm/usr/"
17
+ rvm pkg install openssl
18
+ fi
19
+
20
+ rvm install --default $RUBY_VERSION_UNDER_TEST $DISABLE_BINARY $OPEN_SSL_FLAG
11
21
  ruby --version
12
22
 
13
23
  export GOPATH=$HOME/go
14
- export RUBYOPT='-E utf-8'
24
+ if [[ $RUBY_VERSION_UNDER_TEST == "2.6.10" || $RUBY_VERSION_UNDER_TEST == "2.7.8" ]]; then
25
+ export RUBYOPT='-E utf-8 -W0'
26
+ gem install "rubygems-update:<3.5.0" --no-document
27
+ gem update --system --conservative
28
+ else
29
+ export RUBYOPT='-E utf-8'
30
+ gem update --system
31
+ fi
15
32
 
16
- gem update --system
17
33
  gem install bundler
18
34
  bundle install
19
35
  bundle pristine
data/ci/tasks/rubocop.yml CHANGED
@@ -4,9 +4,9 @@ image_resource:
4
4
  type: registry-image
5
5
  source:
6
6
  repository: ruby
7
- tag: 3.1.1
8
- username: ((LicenseFinderDocker.username))
9
- password: ((LicenseFinderDocker.password))
7
+ tag: 3.2.3
8
+ username: ((license-finder-docker-username))
9
+ password: ((license-finder-docker-password))
10
10
 
11
11
  inputs:
12
12
  - name: LicenseFinder
@@ -4,8 +4,8 @@ image_resource:
4
4
  source:
5
5
  repository: brenix/alpine-bash-git-ssh
6
6
  tag: latest
7
- username: ((LicenseFinderDocker.username))
8
- password: ((LicenseFinderDocker.password))
7
+ username: ((license-finder-docker-username))
8
+ password: ((license-finder-docker-password))
9
9
  platform: linux
10
10
  inputs:
11
11
  - name: lf-git
@@ -61,9 +61,9 @@ module LicenseFinder
61
61
  clear_logs
62
62
  package_managers = @scanner.active_package_managers
63
63
  package_managers.each do |manager|
64
- logger.debug manager.class, 'Running prepare on project'
64
+ logger.debug manager.class, "Running prepare on project '#{config.project_path}'"
65
65
  manager.prepare
66
- logger.debug manager.class, 'Finished prepare on project', color: :green
66
+ logger.debug manager.class, "Finished prepare on project '#{config.project_path}'", color: :green
67
67
  end
68
68
  end
69
69
 
@@ -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
  ],
@@ -266,13 +364,12 @@ module LicenseFinder
266
364
  'BSD-3',
267
365
  '3-clause BSD',
268
366
  '3-Clause BSD License',
269
- 'BSD-3-Clause',
270
367
  'BSD 3-Clause',
271
368
  'BSD 3-Clause License',
272
- 'The 3-Clause BSD License',
273
369
  'BSD 3-clause New License',
274
370
  'New BSD License',
275
371
  'BSD New license',
372
+ 'BSD License 3',
276
373
  'BSD Licence 3'
277
374
  ],
278
375
  url: 'http://opensource.org/licenses/BSD-3-Clause',
@@ -299,8 +396,11 @@ module LicenseFinder
299
396
  pretty_name: 'Python Software Foundation License',
300
397
  other_names: [
301
398
  'PSF',
399
+ 'PSF 2.0',
302
400
  'PSFL',
303
- 'PSF License'
401
+ 'Python 2.0',
402
+ 'PSF License',
403
+ 'PSF License 2.0'
304
404
  ],
305
405
  url: 'http://hg.python.org/cpython/raw-file/89ce323357db/LICENSE'
306
406
  )
@@ -331,14 +431,22 @@ module LicenseFinder
331
431
  other_names: [
332
432
  'FreeBSD',
333
433
  '2-clause BSD',
334
- 'BSD-2-Clause',
335
434
  'BSD 2-Clause',
336
- 'The BSD 2-Clause License'
435
+ 'BSD 2-Clause License'
337
436
  ],
338
437
  url: 'http://opensource.org/licenses/bsd-license'
339
438
  )
340
439
  end
341
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
+
342
450
  def wtfpl
343
451
  License.new(
344
452
  short_name: 'WTFPL',