license_finder 6.2.0 → 6.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/CHANGELOG.md +61 -0
  4. data/Dockerfile +23 -15
  5. data/README.md +24 -2
  6. data/Rakefile +1 -1
  7. data/VERSION +1 -1
  8. data/ci/pipelines/release.yml.erb +15 -5
  9. data/ci/tasks/rubocop.yml +1 -1
  10. data/lib/license_finder/cli.rb +1 -0
  11. data/lib/license_finder/cli/base.rb +1 -0
  12. data/lib/license_finder/cli/inherited_decisions.rb +50 -0
  13. data/lib/license_finder/cli/main.rb +3 -1
  14. data/lib/license_finder/configuration.rb +4 -0
  15. data/lib/license_finder/decision_applier.rb +8 -4
  16. data/lib/license_finder/decisions.rb +83 -20
  17. data/lib/license_finder/license.rb +36 -0
  18. data/lib/license_finder/license/definitions.rb +48 -1
  19. data/lib/license_finder/license/templates/0BSD.txt +10 -0
  20. data/lib/license_finder/license/templates/OFL.txt +91 -0
  21. data/lib/license_finder/license/templates/SimplifiedBSD.txt +0 -4
  22. data/lib/license_finder/license/templates/WTFPL.txt +14 -0
  23. data/lib/license_finder/license/text.rb +24 -2
  24. data/lib/license_finder/logger.rb +2 -0
  25. data/lib/license_finder/package.rb +2 -1
  26. data/lib/license_finder/package_manager.rb +6 -2
  27. data/lib/license_finder/package_managers/bundler.rb +1 -3
  28. data/lib/license_finder/package_managers/cargo.rb +2 -1
  29. data/lib/license_finder/package_managers/composer.rb +5 -1
  30. data/lib/license_finder/package_managers/dotnet.rb +2 -1
  31. data/lib/license_finder/package_managers/go_15vendorexperiment.rb +1 -1
  32. data/lib/license_finder/package_managers/go_modules.rb +11 -4
  33. data/lib/license_finder/package_managers/nuget.rb +51 -4
  34. data/lib/license_finder/package_managers/pipenv.rb +1 -1
  35. data/lib/license_finder/package_managers/sbt.rb +3 -1
  36. data/lib/license_finder/package_managers/yarn.rb +16 -2
  37. data/lib/license_finder/package_utils/license_files.rb +2 -2
  38. data/lib/license_finder/packages/bower_package.rb +7 -0
  39. data/lib/license_finder/packages/bundler_package.rb +4 -0
  40. data/lib/license_finder/packages/cargo_package.rb +4 -0
  41. data/lib/license_finder/packages/cocoa_pods_package.rb +4 -0
  42. data/lib/license_finder/packages/composer_package.rb +4 -0
  43. data/lib/license_finder/packages/conan_package.rb +4 -0
  44. data/lib/license_finder/packages/go_package.rb +5 -1
  45. data/lib/license_finder/packages/gradle_package.rb +4 -0
  46. data/lib/license_finder/packages/maven_package.rb +6 -1
  47. data/lib/license_finder/packages/merged_package.rb +1 -1
  48. data/lib/license_finder/packages/mix_package.rb +4 -0
  49. data/lib/license_finder/packages/npm_package.rb +4 -0
  50. data/lib/license_finder/packages/nuget_package.rb +4 -0
  51. data/lib/license_finder/packages/pip_package.rb +13 -2
  52. data/lib/license_finder/packages/rebar_package.rb +4 -0
  53. data/lib/license_finder/packages/yarn_package.rb +4 -0
  54. data/lib/license_finder/reports/csv_report.rb +7 -3
  55. data/lib/license_finder/reports/json_report.rb +2 -0
  56. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9346290d1b6444834799d917362604ab2b8c8cf02c798fa0125d48e2e96b185e
4
- data.tar.gz: 46d7563db0baaf8506c295a14f2872ea72a0f3ba9a96577a7265b74c38026899
3
+ metadata.gz: ee81cbd6066d49c1b93db3632b2d67f23e4fb902acb36c0de7c325d5de34646f
4
+ data.tar.gz: a419dca63dc18e5cc1729ae19121df28017454ecaade8988ed50461c796d5a17
5
5
  SHA512:
6
- metadata.gz: c18721d86285f2cc2ad05ab0e72f615ceefe001607427bedc1ab19cd83f7bbc7ca1a9fa6d5b8925e96438cec68f0be7dfdb243c6f7e43680bea33fa1b4046120
7
- data.tar.gz: 64775a9d8d417fbe9b2a10fcb094e0040268c18a69997b4c2367e8869090b0213e153f7dae3d9fb2641f90bc29694db7e2dfadd357e8e5adb80835ebec7e9bad
6
+ metadata.gz: f4d1ddc619a4216629b35e902a17c59f04ea65de6cce867c9cbfcddfb95281d23879bb595b202d867e388dd5f6f6d5ac68f7fa813a111c27b122aaa353ca6d1a
7
+ data.tar.gz: 5ec2d9e6f798b53870cf6e7196be92d0a596d58d459de70b585f68f8d8e618d8a98a6b91ded3991ed42f4f9a1793496fc9d7db34966900570201eac77ddc1e6e
@@ -48,6 +48,12 @@ Style/MissingRespondToMissing:
48
48
  Enabled: false
49
49
  Style/FormatStringToken:
50
50
  EnforcedStyle: unannotated
51
+ Style/HashEachMethods:
52
+ Enabled: true
53
+ Style/HashTransformKeys:
54
+ Enabled: true
55
+ Style/HashTransformValues:
56
+ Enabled: true
51
57
  Layout/MultilineMethodCallIndentation:
52
58
  Enabled: false
53
59
  DoubleNegation:
@@ -1,3 +1,59 @@
1
+ # [6.6.1] / 2020-06-30
2
+
3
+ ### Changed
4
+ * Handle multiple solution files for nuget [#173021333] - [040d9559](https://github.com/pivotal/LicenseFinder/commit/040d9559a4bda07490255cc34c1a7891081bc511)
5
+ * matches license names from pypi api call with known licenses to avoid returning misformatted licenses [#173421573] - [6b96d746](https://github.com/pivotal/LicenseFinder/commit/6b96d74600034abcacee6ed2b322aa3abfaa0992) - Jeff Jun
6
+ * Update Nuget Package Manager prepare command - [6ac07066](https://github.com/pivotal/LicenseFinder/commit/6ac070668955bc034da1647658440ce5bb0d9bd2) - Jason Smith
7
+
8
+ # [6.6.0] / 2020-06-22
9
+
10
+ # [6.5.0] / 2020-06-01
11
+
12
+ ### Added
13
+ * Support legacy nuget projects [#172950097] - [0cccbcf9](https://github.com/pivotal/LicenseFinder/commit/0cccbcf9aa92f4297ef0174242bdb19da1babc65)
14
+
15
+ ### Changed
16
+ * Upgrade to golang 1.14.3. Update dotnet-sdk to 3.1 - [0969e98f](https://github.com/pivotal/LicenseFinder/commit/0969e98fde4a82f8931601baa4dd96dc01300a14)
17
+
18
+ # [6.4.0] / 2020-05-22
19
+
20
+ Big shout out to @forelabs for introducing many new features and improvements for this release. Thanks again!!
21
+
22
+ ### Added
23
+ * Introducing new inherited_decisions command - [3453feb](https://github.com/pivotal/LicenseFinder/commit/3453feb659a6c3c6e5aa444e3755ddd5d32f3664) - Sven Dunemann
24
+ * Decision Applier: Merge manual and system packages - [c690532](https://github.com/pivotal/LicenseFinder/commit/c690532ec8addab16bef4edd390f05ceb353435f) - Sven Dunemann
25
+ * Introduce package_url to packages - [18972f7](https://github.com/pivotal/LicenseFinder/commit/18972f7b3a04340e1b7bb560780130b68696b8a2) - Sven Dunemann
26
+ * Add --write-headers option for csv exports - [18e01f8](https://github.com/pivotal/LicenseFinder/commit/18e01f8728a9dc525d7567292cc1e2f390ec854d) - Sven Dunemann
27
+ * Yarn: Add authors & install_path - [08a0f67](https://github.com/pivotal/LicenseFinder/commit/08a0f67837a218231217767561f2282c1b3a890a) - Sven Dunemann
28
+ * install path for nuget dependencies [#172251374] - [ad73c946](https://github.com/pivotal/LicenseFinder/commit/ad73c946113846f8f548adfc73542aebb3763175) - Jeff Jun
29
+ * new Rubocop cops - [c4cc6b8b](https://github.com/pivotal/LicenseFinder/commit/c4cc6b8b13273db17b65cecaf24c9053e4989ea1) - Jeff Jun
30
+
31
+ ### Fixed
32
+ * Separate lines in license text with LF when exported to JSON - [baddb976](https://github.com/pivotal/LicenseFinder/commit/baddb976e7a8683c5cc320eddc8c2712dfb16c15) - Robert Huitl
33
+
34
+ ### Changed
35
+ * Go15VendorExperiment: Detect go only if vendor includes go files - [0f8e609](https://github.com/pivotal/LicenseFinder/commit/0f8e609f0921937c6187deccd80e4bc4b7d67ee4) - Sven Dunemann
36
+ * Bump PHP version to 7.4 - [cbe45c5](https://github.com/pivotal/LicenseFinder/commit/cbe45c5cdb3ec200ea215086a3b3eb879e83222a) - Yivan
37
+ * Significantly improve the license text matching file to be more dynamic - [acf5705](https://github.com/pivotal/LicenseFinder/commit/acf570573b4a2414d9c43212dea5d4ecb157319e)
38
+ * Update Ruby version to 2.7.1 [#172295831] - [475e2948](https://github.com/pivotal/LicenseFinder/commit/475e2948ec1ad859aee59e77aa9ce2a51e1a5029)
39
+
40
+ # [6.3.0] / 2020-05-06
41
+
42
+ ### Added
43
+ * OFL License - [d475bbb1](https://github.com/pivotal/LicenseFinder/commit/d475bbb1380e217f154f262caaa73c12f5b9792b) - Sven Dunemann
44
+ * WTFPL License - [ec629170](https://github.com/pivotal/LicenseFinder/commit/ec6291702c28789a33478041dbf6524d603c12ff) - Sven Dunemann
45
+
46
+ * Find the install path for sbt, cargo and composer [#171649609] - [0d525cbf](https://github.com/pivotal/LicenseFinder/commit/0d525cbf5208db5a977f2f3d922d07b5ea6a8b16)
47
+
48
+ ### Changed
49
+ * Bump PHP version to 7.3 - [1c3c3271](https://github.com/pivotal/LicenseFinder/commit/1c3c3271b977a6c8d24e4159a6b8098a51086522)
50
+ * Remove +compatible in Go package versions [#171754392] - [5cba5801](https://github.com/pivotal/LicenseFinder/commit/5cba5801f4f276482f01bfeea46fde0dbbcce7b1)
51
+
52
+ ### Fixed
53
+ * Fixed Maven Package manager Groups check - [5058d90](https://github.com/pivotal/LicenseFinder/commit/5058d90246a25ca15c72e0eed8e19ebbf7e39998) - Ravi Soni
54
+ * GoModules: fix compute with vendor mod - [067eb19](https://github.com/pivotal/LicenseFinder/commit/067eb1916ce024039631bdbd4114ababa6c02c3a) - forelabs
55
+ * Do not set Bundle path. Bundler will figure it out. - [6319a7a](https://github.com/pivotal/LicenseFinder/commit/6319a7a281bd9cc997c08c903674ab51fcc6545e) - mvz
56
+
1
57
  # [6.2.0] / 2020-04-07
2
58
 
3
59
  ### Fixed
@@ -824,3 +880,8 @@ Bugfixes:
824
880
  [6.1.0]: https://github.com/pivotal/LicenseFinder/compare/v6.0.0...v6.1.0
825
881
  [6.1.2]: https://github.com/pivotal/LicenseFinder/compare/v6.1.0...v6.1.2
826
882
  [6.2.0]: https://github.com/pivotal/LicenseFinder/compare/v6.1.2...v6.2.0
883
+ [6.3.0]: https://github.com/pivotal/LicenseFinder/compare/v6.2.0...v6.3.0
884
+ [6.4.0]: https://github.com/pivotal/LicenseFinder/compare/v6.3.0...v6.4.0
885
+ [6.5.0]: https://github.com/pivotal/LicenseFinder/compare/v6.4.0...v6.5.0
886
+ [6.6.0]: https://github.com/pivotal/LicenseFinder/compare/v6.5.0...v6.6.0
887
+ [6.6.1]: https://github.com/pivotal/LicenseFinder/compare/v6.6.0...v6.6.1
data/Dockerfile CHANGED
@@ -3,11 +3,11 @@ FROM ubuntu:xenial
3
3
  # Versioning
4
4
  ENV PIP_INSTALL_VERSION 19.0.2
5
5
  ENV PIP3_INSTALL_VERSION 8.1.1
6
- ENV GO_LANG_VERSION 1.13.3
6
+ ENV GO_LANG_VERSION 1.14.3
7
7
  ENV MAVEN_VERSION 3.6.0
8
8
  ENV SBT_VERSION 1.3.3
9
9
  ENV GRADLE_VERSION 5.6.4
10
- ENV RUBY_VERSION 2.6.5
10
+ ENV RUBY_VERSION 2.7.1
11
11
  ENV MIX_VERSION 1.0
12
12
  ENV COMPOSER_ALLOW_SUPERUSER 1
13
13
 
@@ -38,10 +38,12 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
38
38
  RUN npm install -g bower && \
39
39
  echo '{ "allow_root": true }' > /root/.bowerrc
40
40
 
41
- # install jdk 11
41
+ # install jdk 12
42
42
  RUN curl -L -o openjdk12.tar.gz https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz && \
43
43
  tar xvf openjdk12.tar.gz && \
44
- sudo mv jdk-12.0.2 /opt/
44
+ rm openjdk12.tar.gz && \
45
+ sudo mv jdk-12.0.2 /opt/ && \
46
+ sudo rm /opt/jdk-12.0.2/lib/src.zip
45
47
  ENV JAVA_HOME=/opt/jdk-12.0.2
46
48
  ENV PATH=$PATH:$JAVA_HOME/bin
47
49
  RUN java -version
@@ -51,8 +53,8 @@ RUN apt-get install -y python rebar
51
53
 
52
54
  # install and update python-pip
53
55
  RUN apt-get install -y python-pip python3-pip && \
54
- pip2 install --upgrade pip==$PIP_INSTALL_VERSION && \
55
- pip3 install --upgrade pip==$PIP3_INSTALL_VERSION
56
+ pip2 install --no-cache-dir --upgrade pip==$PIP_INSTALL_VERSION && \
57
+ pip3 install --no-cache-dir --upgrade pip==$PIP3_INSTALL_VERSION
56
58
 
57
59
  # install maven
58
60
  RUN curl -O https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
@@ -95,7 +97,8 @@ RUN mkdir /gopath && \
95
97
  go get github.com/Masterminds/glide && \
96
98
  go get github.com/kardianos/govendor && \
97
99
  go get github.com/golang/dep/cmd/dep && \
98
- go get -u github.com/rancher/trash
100
+ go get -u github.com/rancher/trash && \
101
+ go clean -cache
99
102
 
100
103
  # Fix the locale
101
104
  RUN apt-get install -y locales
@@ -123,11 +126,14 @@ RUN bash -lc "gem update --system && gem install bundler"
123
126
 
124
127
  # install conan
125
128
  RUN apt-get install -y python-dev && \
126
- pip install --ignore-installed six --ignore-installed colorama --ignore-installed requests --ignore-installed chardet --ignore-installed urllib3 --upgrade setuptools && \
127
- pip install -Iv conan==1.11.2
129
+ pip install --no-cache-dir --ignore-installed six --ignore-installed colorama \
130
+ --ignore-installed requests --ignore-installed chardet \
131
+ --ignore-installed urllib3 \
132
+ --upgrade setuptools && \
133
+ pip install --no-cache-dir -Iv conan==1.11.2
128
134
 
129
135
  # install Cargo
130
- RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
136
+ RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --profile minimal
131
137
 
132
138
  # install NuGet (w. mono)
133
139
  # https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools#macoslinux
@@ -135,19 +141,21 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E03280
135
141
  echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list &&\
136
142
  apt-get update &&\
137
143
  apt-get install -y mono-complete &&\
138
- curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe &&\
139
- echo "alias nuget=\"mono /usr/local/bin/nuget.exe\"" >> ~/.bash_aliases
144
+ curl -o "/usr/local/bin/nuget.exe" "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" &&\
145
+ curl -o "/usr/local/bin/nugetv3.5.0.exe" "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe"
140
146
 
141
147
  # install dotnet core
148
+ WORKDIR /tmp
142
149
  RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb &&\
143
150
  sudo dpkg -i packages-microsoft-prod.deb &&\
151
+ rm packages-microsoft-prod.deb &&\
144
152
  sudo apt-get update &&\
145
- sudo apt-get install -y dotnet-runtime-2.1 dotnet-sdk-2.1 dotnet-sdk-2.2 dotnet-sdk-3.0
153
+ sudo apt-get install -y dotnet-runtime-2.1 dotnet-sdk-2.1 dotnet-sdk-2.2 dotnet-sdk-3.0 dotnet-sdk-3.1
146
154
 
147
155
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5267A6C &&\
148
156
  echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/php.list &&\
149
157
  apt-get update &&\
150
- apt-get install -y php7.1-cli &&\
158
+ apt-get install -y php7.4-cli &&\
151
159
  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &&\
152
160
  php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" &&\
153
161
  php composer-setup.php &&\
@@ -156,7 +164,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5
156
164
 
157
165
  # install license_finder
158
166
  COPY . /LicenseFinder
159
- RUN bash -lc "cd /LicenseFinder && bundle install -j4 && rake install"
167
+ RUN bash -lc "cd /LicenseFinder && bundle config set no-cache 'true' && bundle install -j4 && rake install"
160
168
 
161
169
  WORKDIR /
162
170
 
data/README.md CHANGED
@@ -7,7 +7,7 @@ Build status
7
7
  * Ruby 2.4.9 [![Ruby 2.4.9 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.4.9/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
8
8
  * Ruby 2.5.7 [![Ruby 2.5.7 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.5.7/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
9
9
  * Ruby 2.6.5 [![Ruby 2.6.5 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.6.5/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
10
- * Ruby 2.7.0 [![Ruby 2.7.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.7.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
10
+ * Ruby 2.7.1 [![Ruby 2.7.1 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.7.1/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
11
11
  * JRuby 9.2.9.0 [![JRuby 9.2.9.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-jruby-9.2.9.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
12
12
 
13
13
 
@@ -359,7 +359,7 @@ $ license_finder dependencies remove my_js_dep
359
359
  Sometimes a project will have development or test dependencies which
360
360
  you don't want to track. You can exclude theses dependencies by running
361
361
  `license_finder ignored_groups`. (Currently this only works for packages
362
- managed by Bundler, NPM, and Nuget.)
362
+ managed by Bundler, NPM, Yarn, Maven, Pip2, Pip3, and Nuget.)
363
363
 
364
364
  On rare occasions a package manager will report an individual dependency
365
365
  that you want to exclude from all reports, even though it is approved.
@@ -379,6 +379,26 @@ items, even if someone attempts to manually approve or permit it. However,
379
379
  if a dependency has even one license that is not restricted, it can still be
380
380
  manually approved or permitted.
381
381
 
382
+ ## Decision inheritance
383
+
384
+ Add or remove decision files you want to inherit from - see `license_finder inherited_decisions help` for more information.
385
+
386
+ This allows you to have a centralized decision file for approved/restricted licenses. If you have multiple projects it's way easier to have one single place where you approved or restricted licenses defined.
387
+
388
+ Add one or more decision files to the inherited decisions
389
+ ```bash
390
+ license_finder inherited_decisions add DECISION_FILE
391
+ ```
392
+
393
+ Remove one or more decision files from the inherited decisions
394
+ ```bash
395
+ license_finder inherited_decisions remove DECISION_FILE
396
+ ```
397
+
398
+ List all the inherited decision files
399
+ ```bash
400
+ license_finder inherited_decisions list
401
+ ```
382
402
 
383
403
  ## Configuration
384
404
 
@@ -467,6 +487,8 @@ licenseConfigurations := Set("compile", "provided")
467
487
 
468
488
  ## Upgrading
469
489
 
490
+ To upgrade to `license_finder` version >= 6.0, you have to replace the terminology `whitelist` with `permit` and `blacklist` with `restrict` in your `dependency_decisions.yml`. See [Changelog](https://github.com/pivotal/LicenseFinder/blob/master/CHANGELOG.md#600--2020-01-22) for more details.
491
+
470
492
  To upgrade from `license_finder` version 1.2 to 2.0, see
471
493
  [`license_finder_upgrade`](https://github.com/mainej/license_finder_upgrade).
472
494
  To upgrade to 2.0 from a version lower than 1.2, first upgrade to 1.2, and run
data/Rakefile CHANGED
@@ -63,7 +63,7 @@ task :update_pipeline, [:slack_url, :slack_channel] do |_, args|
63
63
  puts 'Warning: You should provide slack channel and url to receive slack notifications on build failures'
64
64
  end
65
65
 
66
- ruby_versions = %w[2.7.0 2.6.5 2.5.7 2.4.9 2.3.8 jruby-9.2.9.0]
66
+ ruby_versions = %w[2.7.1 2.6.5 2.5.7 2.4.9 2.3.8 jruby-9.2.9.0]
67
67
 
68
68
  params = []
69
69
  params << "ruby_versions=#{ruby_versions.join(',')}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.2.0
1
+ 6.6.1
@@ -24,7 +24,7 @@ resources:
24
24
  source:
25
25
  driver: gcs
26
26
  bucket: lf-semver-version
27
- key: VERSION
27
+ key: version
28
28
  json_key: ((GCPQueuedReportsBucketCredentials))
29
29
 
30
30
  - name: dockerhub-edge
@@ -123,21 +123,31 @@ jobs:
123
123
 
124
124
  - name: bump-major
125
125
  plan:
126
- - put: semver-version
126
+ - get: semver-version
127
127
  tags: ["private-worker"]
128
128
  params: {bump: major}
129
+ - put: semver-version
130
+ tags: ["private-worker"]
131
+ params: {file: semver-version/version}
132
+
129
133
 
130
134
  - name: bump-minor
131
135
  plan:
132
- - put: semver-version
136
+ - get: semver-version
133
137
  tags: ["private-worker"]
134
138
  params: {bump: minor}
139
+ - put: semver-version
140
+ tags: ["private-worker"]
141
+ params: {file: semver-version/version}
135
142
 
136
143
  - name: bump-patch
137
144
  plan:
138
- - put: semver-version
145
+ - get: semver-version
139
146
  tags: ["private-worker"]
140
147
  params: {bump: patch}
148
+ - put: semver-version
149
+ tags: ["private-worker"]
150
+ params: {file: semver-version/version}
141
151
 
142
152
  - name: release
143
153
  disable_manual_trigger: true
@@ -164,7 +174,7 @@ jobs:
164
174
  - put: dockerhub
165
175
  tags: ["private-worker"]
166
176
  params:
167
- build: lf-git
177
+ build: lf-git-changed
168
178
  tag: version/version.txt
169
179
  tag_as_latest: true
170
180
  - put: lf-git
@@ -4,7 +4,7 @@ image_resource:
4
4
  type: registry-image
5
5
  source:
6
6
  repository: ruby
7
- tag: 2.6.5
7
+ tag: 2.7.1
8
8
 
9
9
  inputs:
10
10
  - name: LicenseFinder
@@ -8,6 +8,7 @@ end
8
8
  require 'license_finder/cli/patched_thor'
9
9
  require 'license_finder/cli/base'
10
10
  require 'license_finder/cli/makes_decisions'
11
+ require 'license_finder/cli/inherited_decisions'
11
12
  require 'license_finder/cli/permitted_licenses'
12
13
  require 'license_finder/cli/restricted_licenses'
13
14
  require 'license_finder/cli/dependencies'
@@ -44,6 +44,7 @@ module LicenseFinder
44
44
  :elixir_command,
45
45
  :mix_command,
46
46
  :mix_deps_dir,
47
+ :write_headers,
47
48
  :save,
48
49
  :prepare,
49
50
  :prepare_no_fail,
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LicenseFinder
4
+ module CLI
5
+ class InheritedDecisions < Base
6
+ extend Subcommand
7
+ include MakesDecisions
8
+
9
+ desc 'list', 'List all the inherited decision files'
10
+ def list
11
+ say 'Inherited Decision Files:', :blue
12
+ say_each(decisions.inherited_decisions)
13
+ end
14
+
15
+ auditable
16
+ desc 'add DECISION_FILE...', 'Add one or more decision files to the inherited decisions'
17
+ def add(*decision_files)
18
+ assert_some decision_files
19
+ modifying { decision_files.each { |filepath| decisions.inherit_from(filepath) } }
20
+ say "Added #{decision_files.join(', ')} to the inherited decisions"
21
+ end
22
+
23
+ auditable
24
+ desc 'add_with_auth URL AUTH_TYPE TOKEN_OR_ENV', 'Add a remote decision file that needs authentication'
25
+ def add_with_auth(*params)
26
+ url, auth_type, token_or_env = params
27
+ auth_info = { 'url' => url, 'authorization' => "#{auth_type} #{token_or_env}" }
28
+ modifying { decisions.add_decision [:inherit_from, auth_info] }
29
+ say "Added #{url} to the inherited decisions"
30
+ end
31
+
32
+ auditable
33
+ desc 'remove DECISION_FILE...', 'Remove one or more decision files from the inherited decisions'
34
+ def remove(*decision_files)
35
+ assert_some decision_files
36
+ modifying { decision_files.each { |filepath| decisions.remove_inheritance(filepath) } }
37
+ say "Removed #{decision_files.join(', ')} from the inherited decisions"
38
+ end
39
+
40
+ auditable
41
+ desc 'remove_with_auth URL AUTH_TYPE TOKEN_OR_ENV', 'Add a remote decision file that needs authentication'
42
+ def remove_with_auth(*params)
43
+ url, auth_type, token_or_env = params
44
+ auth_info = { 'url' => url, 'authorization' => "#{auth_type} #{token_or_env}" }
45
+ modifying { decisions.remove_inheritance(auth_info) }
46
+ say "Removed #{url} from the inherited decisions"
47
+ end
48
+ end
49
+ end
50
+ end
@@ -140,6 +140,7 @@ module LicenseFinder
140
140
  desc 'report', "Print a report of the project's dependencies to stdout"
141
141
  shared_options
142
142
  format_option
143
+ method_option :write_headers, type: :boolean, desc: 'Write exported columns as header row (csv).', default: false, required: false
143
144
  method_option :save, desc: "Save report to a file. Default: 'license_report.csv' in project root.", lazy_default: 'license_report'
144
145
 
145
146
  def report
@@ -171,6 +172,7 @@ module LicenseFinder
171
172
  subcommand 'permitted_licenses', PermittedLicenses, 'Automatically approve any dependency that has a permitted license'
172
173
  subcommand 'restricted_licenses', RestrictedLicenses, 'Forbid approval of any dependency whose licenses are all restricted'
173
174
  subcommand 'project_name', ProjectName, 'Set the project name, for display in reports'
175
+ subcommand 'inherited_decisions', InheritedDecisions, 'Add or remove decision files you want to inherit from'
174
176
 
175
177
  private
176
178
 
@@ -203,7 +205,7 @@ module LicenseFinder
203
205
  def report_of(content)
204
206
  report = FORMATS[config.format] || FORMATS['text']
205
207
  report = MergedReport if report == CsvReport && config.aggregate_paths
206
- report.of(content, columns: config.columns, project_name: decisions.project_name || config.project_path.basename.to_s)
208
+ report.of(content, columns: config.columns, project_name: decisions.project_name || config.project_path.basename.to_s, write_headers: config.write_headers)
207
209
  end
208
210
 
209
211
  def save?
@@ -109,6 +109,10 @@ module LicenseFinder
109
109
  get(:prepare_no_fail)
110
110
  end
111
111
 
112
+ def write_headers
113
+ get(:write_headers)
114
+ end
115
+
112
116
  def save_file
113
117
  get(:save)
114
118
  end
@@ -4,7 +4,7 @@ module LicenseFinder
4
4
  class DecisionApplier
5
5
  def initialize(options)
6
6
  @decisions = options.fetch(:decisions)
7
- @all_packages = decisions.packages + options.fetch(:packages)
7
+ @all_packages = options.fetch(:packages).to_set + @decisions.packages.to_set
8
8
  @acknowledged = apply_decisions
9
9
  end
10
10
 
@@ -28,10 +28,14 @@ module LicenseFinder
28
28
 
29
29
  def apply_decisions
30
30
  all_packages
31
- .map { |package| with_decided_licenses(package) }
32
- .map { |package| with_approval(package) }
33
- .map { |package| with_homepage(package) }
34
31
  .reject { |package| ignored?(package) }
32
+ .map do |package|
33
+ with_homepage(
34
+ with_approval(
35
+ with_decided_licenses(package)
36
+ )
37
+ )
38
+ end
35
39
  end
36
40
 
37
41
  def ignored?(package)