licensed 3.4.0 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3cb5bf8c20bf1177466536fbc30bc29135a9e76933e225af8353ba8eb89205d
4
- data.tar.gz: 26acda6f4b9d90c2457725ecda8f0b00bc7fc793a4993a1e6aa9a6810a995d04
3
+ metadata.gz: 1a241c3ec016e1b2f49cc7a4ed53c53ee07a45fb5dc5f1b6655e6c4e5acf2d6d
4
+ data.tar.gz: 26e55577302098d09128c87d422856307841fa85dd95c181a7fe9280713ee644
5
5
  SHA512:
6
- metadata.gz: 5d71df74f6fca5c309230b18a7423f608cdf61ca0a5ddf9f45116b75681196a15ecee70d4d56877841b82c1d75d43fa573182ec300f1976a1e815f169de1598f
7
- data.tar.gz: 645c4bf3cbb162e46061b730f947f0299336506fa425640f215e0e96ccb89124ef0e8a9725e6b9044fcd1c8e38c8809b7f5a911479d6583cc097b15d1f4a48c3
6
+ metadata.gz: 4358bc3c0f238d569beb172ded8589088336a64ccac81f55f2f669e7619c59c5590fdda1b88c5d3812cc8f554af2381ec1f74f40798634a547a6e8884d33c10e
7
+ data.tar.gz: 751818fb0934e5cf80629971267373117d1649d6ec65f8ae35477f53153307a4fee7893d9182f9b112fe622d8554656ca4892717084793b31577cb1b86557fad
data/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## 3.4.1
10
+
11
+ 2022-01-07
12
+
13
+ ### Fixed
14
+
15
+ - Malformed package.json files will no longer crash yarn dependency detection (https://github.com/github/licensed/pull/431)
16
+
9
17
  ## 3.4.0
10
18
 
11
19
  2021-12-14
@@ -539,4 +547,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
539
547
 
540
548
  Initial release :tada:
541
549
 
542
- [Unreleased]: https://github.com/github/licensed/compare/3.4.0...HEAD
550
+ [Unreleased]: https://github.com/github/licensed/compare/3.4.1...HEAD
@@ -39,30 +39,34 @@ The following data is reported for each dependency when the YAML or JSON report
39
39
 
40
40
  ### cached dependency record not found
41
41
 
42
- **Cause:** A dependency was found while running `licensed status` that does not have a corresponding cached metadata file
43
- **Resolution:** Run `licensed cache` to update the metadata cache and create the missing metadata file
42
+ *Cause:* A dependency was found while running `licensed status` that does not have a corresponding cached metadata file
43
+
44
+ *Resolution:* Run `licensed cache` to update the metadata cache and create the missing metadata file
44
45
 
45
46
  ### cached dependency record out of date
46
47
 
47
- **Cause:** A dependency was found while running `licensed status` with a different version than is contained in the dependency's cached metadata file
48
- **Resolution:** Run `licensed cache` to update the out-of-date metadata files
48
+ *Cause:* A dependency was found while running `licensed status` with a different version than is contained in the dependency's cached metadata file
49
+
50
+ *Resolution:* Run `licensed cache` to update the out-of-date metadata files
49
51
 
50
52
  ### missing license text
51
53
 
52
- **Cause:** A license determination was made, e.g. from package metadata, but no license text was found.
53
- **Resolution:** Manually verify whether the dependency includes a file containing license text. If the dependency code that was downloaded locally does not contain the license text, please check the dependency source at the version listed in the dependency's cached metadata file to see if there is license text that can be used.
54
+ *Cause:* A license determination was made, e.g. from package metadata, but no license text was found.
55
+
56
+ *Resolution:* Manually verify whether the dependency includes a file containing license text. If the dependency code that was downloaded locally does not contain the license text, please check the dependency source at the version listed in the dependency's cached metadata file to see if there is license text that can be used.
54
57
 
55
58
  If the dependency does not include license text but does specify that it uses a specific license, please copy the standard license text from a [well known source](https://opensource.org/licenses).
56
59
 
57
60
  ### license text has changed and needs re-review. if the new text is ok, remove the `review_changed_license` flag from the cached record
58
61
 
59
- **Cause:** A dependency that is set as [reviewed] in the licensed configuration file has substantially changed and should be re-reviewed.
60
- **Resolution:** Review the changes to the license text and classification, along with other metadata contained in the cached file for the dependency. If the dependency is still allowable for use in your project, remove the `review_changed_license` key from the cached record file.
62
+ *Cause:* A dependency that is set as [reviewed] in the licensed configuration file has substantially changed and should be re-reviewed.
63
+
64
+ *Resolution:* Review the changes to the license text and classification, along with other metadata contained in the cached file for the dependency. If the dependency is still allowable for use in your project, remove the `review_changed_license` key from the cached record file.
61
65
 
62
66
  ### license needs review
63
67
 
64
- **Cause:** A dependency is using a license that is not in the configured [allowed list of licenses][allowed], and the dependency has not been marked [ignored] or [reviewed].
65
- **Resolution:** Review the dependency's usage and specified license with someone familiar with OSS licensing and compliance rules to determine whether the dependency is allowable. Some common resolutions:
68
+ *Cause:* A dependency is using a license that is not in the configured [allowed list of licenses][allowed], and the dependency has not been marked [ignored] or [reviewed].
69
+ *Resolution:* Review the dependency's usage and specified license with someone familiar with OSS licensing and compliance rules to determine whether the dependency is allowable. Some common resolutions:
66
70
 
67
71
  1. The dependency's specified license text differed enough from the standard license text that it was not recognized and classified as `other`. If, with human review, the license text is recognizable then update the `license: other` value in the cached metadata file to the correct license.
68
72
  - An updated classification will persist through version upgrades until the detected license contents have changed. The determination is made by [licensee/licensee](https://github.com/licensee/licensee), the library which this tool uses to detect and classify license contents.
@@ -63,9 +63,15 @@ module Licensed
63
63
  # by parsing every package.json file under node_modules.
64
64
  def dependency_paths
65
65
  @dependency_paths ||= Dir.glob(config.pwd.join("node_modules/**/package.json")).each_with_object({}) do |file, hsh|
66
- dirname = File.dirname(file)
67
- json = JSON.parse(File.read(file))
68
- hsh["#{json["name"]}-#{json["version"]}"] = dirname
66
+ begin
67
+ dirname = File.dirname(file)
68
+ json = JSON.parse(File.read(file))
69
+ hsh["#{json["name"]}-#{json["version"]}"] = dirname
70
+ rescue JSON::ParserError
71
+ # don't crash execution if there is a problem parsing a package.json file
72
+ # if the bad package.json file relates to a package that licensed should be reporting on
73
+ # then this will still result in an error about a missing package
74
+ end
69
75
  end
70
76
  end
71
77
 
@@ -77,9 +77,15 @@ module Licensed
77
77
  # by parsing every package.json file under node_modules.
78
78
  def dependency_paths
79
79
  @dependency_paths ||= Dir.glob(config.pwd.join("node_modules/**/package.json")).each_with_object({}) do |file, hsh|
80
- dirname = File.dirname(file)
81
- json = JSON.parse(File.read(file))
82
- hsh["#{json["name"]}@#{json["version"]}"] = dirname
80
+ begin
81
+ dirname = File.dirname(file)
82
+ json = JSON.parse(File.read(file))
83
+ hsh["#{json["name"]}@#{json["version"]}"] = dirname
84
+ rescue JSON::ParserError
85
+ # don't crash execution if there is a problem parsing a package.json file
86
+ # if the bad package.json file relates to a package that licensed should be reporting on
87
+ # then this will still result in an error about a missing package
88
+ end
83
89
  end
84
90
  end
85
91
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Licensed
3
- VERSION = "3.4.0".freeze
3
+ VERSION = "3.4.1".freeze
4
4
 
5
5
  def self.previous_major_versions
6
6
  major_version = Gem::Version.new(Licensed::VERSION).segments.first
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensed
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2022-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee