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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a65abcec91ace2929ab66aa2e364002c4019e8cfd5ffdde361ce0ea4b20147f8
4
- data.tar.gz: cfeaa1bf0a57a0480d8193fa10a75597b7421abcaa15d6995adc3a885797f547
3
+ metadata.gz: ea2f57657f8f3dba53174ad258ba5110faea56db4bc43053d0534758dae68cf6
4
+ data.tar.gz: b4f8e8a5a1f079f0a0d72cf204136c90146d5e769e39a892b7400ad5df1b5fbd
5
5
  SHA512:
6
- metadata.gz: c699e9127e4740d8795b5f494525c31251fa4dea297ebdd3c965b3d8bfc129d56d469135f2eb9614d244ed2828798008000116166fd55c1ac6ef5412e7d87313
7
- data.tar.gz: e78c9b61fdf161c85c813a9892f02e470bc036f0061720a0fac73120394fb1f9e4161b6a935acb500ae55ac6c03d2ed6df6a320dda5cbc1443be6f62747c4f51
6
+ metadata.gz: c22e4175e51437d7be9b3a0fda548fe71df5f7620e78ffbfe855eb26c81b6f6add55a9358e845f3d312b51ba077804f951c830339c7364b33426b5aa7658b06d
7
+ data.tar.gz: 74189994406c098243463a2d2da803453f6ad8550eb0b77df294158add2cd1694051b2e26f224eceb2a6719f6e66d0e7c9b90cf8d5a502404c035fe8677279bf
@@ -7,3 +7,10 @@ updates:
7
7
  time: "20:00"
8
8
  timezone: America/Los_Angeles
9
9
  open-pull-requests-limit: 10
10
+ - package-ecosystem: docker
11
+ directory: "/"
12
+ schedule:
13
+ interval: daily
14
+ time: "20:00"
15
+ timezone: America/Los_Angeles
16
+ open-pull-requests-limit: 10
@@ -0,0 +1,10 @@
1
+ - id: license-finder
2
+ name: Audit licenses of dependencies
3
+ entry: license_finder
4
+ language: ruby
5
+ pass_filenames: false
6
+ description: >
7
+ LicenseFinder works with your package managers to find dependencies, detect
8
+ the licenses of the packages in them, compare those licenses against a
9
+ user-defined list of permitted licenses, and give you an actionable
10
+ exception report.
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4.0
2
+ TargetRubyVersion: 2.6.0
3
3
  Exclude:
4
4
  - 'lib/license_finder/reports/**/*'
5
5
  - 'features/fixtures/**/*'
@@ -78,3 +78,7 @@ FileName:
78
78
  ModuleFunction:
79
79
  Enabled: false
80
80
  EnforcedStyle: extend_self
81
+ # Custom ERB Template needs the to_s
82
+ Lint/RedundantStringCoercion:
83
+ Exclude:
84
+ - 'examples/custom_erb_template.rb'
data/CHANGELOG.md CHANGED
@@ -1,4 +1,43 @@
1
+ # [7.2.0] / 2024-05-07
2
+
3
+ ### Added
4
+ * Add more license detection - [b3dde46e](https://github.com/pivotal/LicenseFinder/commit/b3dde46e2018aef9b6436a04777ec33d40a134e4) - Simon Warren
5
+ * Unlicense - [6fb571ca](https://github.com/pivotal/LicenseFinder/commit/6fb571cad9b5ee856c0984ca79aa7604afdd818b) - Jim Kane
6
+
7
+ ### Fixed
8
+ * Ensure licenses are recognised by `spdx_id` - [b263f500](https://github.com/pivotal/LicenseFinder/commit/b263f500eaaf802e90ee023c4a6c4b6aa068dd7e) - Simon Warren
9
+ * Ensure yarn runs in "current" project dir - [37d52f2b](https://github.com/pivotal/LicenseFinder/commit/37d52f2b4503d799a4c551b573848e9bbbce4848) - Simon Warren
10
+ * Fix CPL1 pretty name - [3ae49861](https://github.com/pivotal/LicenseFinder/commit/3ae49861dbfaf0bbd023d68dabad067f32775f48) - Simon Warren
11
+ * Fix 'unknown' Yarn 2 licenses - [f57745be](https://github.com/pivotal/LicenseFinder/commit/f57745be34bb7774577ea577671ea7b5c3246576) - Simon Warren
12
+ * Print subproject paths when logging - [add2f969](https://github.com/pivotal/LicenseFinder/commit/add2f9698a0f3c02d3148655a4b538e2f557d2be) - Simon Warren
13
+
14
+ ### Deprecated
15
+ * - Remove Dep package manager for jammy release - [42bed10d](https://github.com/pivotal/LicenseFinder/commit/42bed10d80e4b0e6fac1c62dd5eca2097ffc3517)
16
+
17
+ # [7.1.0] / 2022-11-28
18
+
19
+ ### Added
20
+ * Missing New BSD alternative name - [64d425d9](https://github.com/pivotal/LicenseFinder/commit/64d425d9210794c6b45c60bf730931e459a1e959)
21
+ * pre-commit hook - [2fd5ac85](https://github.com/pivotal/LicenseFinder/commit/2fd5ac85fbd4ea03b6f274f2c977448a8a517c2c) - Kurt von Laven
22
+
23
+ ### Fixed
24
+ * - Apache 2 license being too restrictive on matching - [c7fd0399](https://github.com/pivotal/LicenseFinder/commit/c7fd03994592ca97408f5134dd9eac6566e51c48)
25
+ * - Erlang not installing properly with mix - [74af3885](https://github.com/pivotal/LicenseFinder/commit/74af388579dd2f26b1814ece39c869d684218cd9)
26
+ * Scan transitive Yarn v2+ dependencies - [0115445e](https://github.com/pivotal/LicenseFinder/commit/0115445eb26de3185518adfb257b0e1911cf2fbd) - Kurt von Laven
27
+
28
+ * Issue with chaining commands with dlf - [a6af8c3e](https://github.com/pivotal/LicenseFinder/commit/a6af8c3e0abb932ed8d3c0215175f23cf75b5fb2)
29
+ * Nuget and dotnet not returning proper licenses - [e3452336](https://github.com/pivotal/LicenseFinder/commit/e3452336aa980f26de9a7d44d725bddb0ddd67a0)
30
+ * Save help documentation for the default file name - [09a93762](https://github.com/pivotal/LicenseFinder/commit/09a93762dc3bd714fdcdebb4aa84af4c7dbefa04)
31
+ * - Yarn2 output parsing - [395a7f02](https://github.com/pivotal/LicenseFinder/commit/395a7f02b7729243aaf730b6ede71cae8f21cfeb)
32
+
33
+ ### Changed
34
+ * - Bump docker image golang version to 1.17.13 - [4f3df246](https://github.com/pivotal/LicenseFinder/commit/4f3df246d2f5245681a943a6fb6dee49e3ed3ed1)
35
+
1
36
  # [7.0.1] / 2022-03-18
37
+ ### Fixed
38
+ * Maven Wrapper command path must be relative to working directory - [298a733a](https://github.com/pivotal/LicenseFinder/commit/298a733a67f34341ffabc7dfbf2ee5c27574b979) - jbmgrtn
39
+ * Support yarn license command for yarn v2+ - [ed3b319b](https://github.com/pivotal/LicenseFinder/commit/ed3b319b64bf9c72c12fd5a365952137cf7f33b6)
40
+
2
41
 
3
42
  # [7.0.0] / 2022-03-04
4
43
 
@@ -1010,3 +1049,5 @@ Bugfixes:
1010
1049
  [6.15.0]: https://github.com/pivotal/LicenseFinder/compare/v6.14.2...v6.15.0
1011
1050
  [7.0.0]: https://github.com/pivotal/LicenseFinder/compare/v6.15.0...v7.0.0
1012
1051
  [7.0.1]: https://github.com/pivotal/LicenseFinder/compare/v7.0.0...v7.0.1
1052
+ [7.1.0]: https://github.com/pivotal/LicenseFinder/compare/v7.0.1...v7.1.0
1053
+ [7.2.0]: https://github.com/pivotal/LicenseFinder/compare/v7.1.0...v7.2.0
data/CONTRIBUTING.md CHANGED
@@ -78,6 +78,7 @@ If you come up with something useful, consider posting it to the Google Group
78
78
  To successfully run the test suite, you will need the following installed:
79
79
  - NPM (requires Node)
80
80
  - Yarn (requires Node)
81
+ - PNPM (requires Node)
81
82
  - Bower (requires Node and NPM)
82
83
  - Maven (requires Java)
83
84
  - Gradle (requires Java)
data/Dockerfile CHANGED
@@ -1,75 +1,74 @@
1
- FROM ubuntu:bionic
1
+ FROM ubuntu:jammy
2
2
 
3
3
  WORKDIR /tmp
4
4
 
5
5
  # Versioning
6
- ENV PIP_INSTALL_VERSION 19.0.2
7
6
  ENV PIP3_INSTALL_VERSION 20.0.2
8
- ENV GO_LANG_VERSION 1.14.3
9
- ENV MAVEN_VERSION 3.6.0
7
+ ENV GO_LANG_VERSION 1.17.13
10
8
  ENV SBT_VERSION 1.3.3
11
9
  ENV GRADLE_VERSION 5.6.4
12
- ENV RUBY_VERSION 3.1.1
13
- ENV MIX_VERSION 1.0
10
+ ENV RUBY_VERSION 3.2.3
14
11
  ENV COMPOSER_ALLOW_SUPERUSER 1
15
12
 
16
13
  # programs needed for building
17
- RUN apt-get update && apt-get install -y \
18
- build-essential \
19
- curl \
20
- sudo \
21
- unzip \
22
- wget \
23
- gnupg2 \
24
- apt-utils \
25
- software-properties-common \
26
- bzr
27
-
28
- RUN add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git
29
-
30
- # nodejs seems to be required for the one of the gems
31
- RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
32
- apt-get -y install nodejs
14
+ RUN apt -q update && apt install -y \
15
+ build-essential \
16
+ curl \
17
+ unzip \
18
+ wget \
19
+ gnupg2 \
20
+ apt-utils \
21
+ software-properties-common \
22
+ bzr && \
23
+ rm -rf /var/lib/apt/lists/*
24
+
25
+ RUN add-apt-repository ppa:git-core/ppa && \
26
+ apt -q update && apt install -y git && rm -rf /var/lib/apt/lists/*
27
+
28
+ # install nodejs
29
+ RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
30
+ apt -q update && apt install -y nodejs && rm -rf /var/lib/apt/lists/*
33
31
 
34
32
  # install yarn
35
- RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
36
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
37
- apt-get update && \
38
- apt-get install yarn
33
+ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
34
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
35
+ apt -q update && apt install -y yarn && rm -rf /var/lib/apt/lists/*
39
36
 
40
37
  # install bower
41
38
  RUN npm install -g bower && \
42
39
  echo '{ "allow_root": true }' > /root/.bowerrc
43
40
 
41
+ # install pnpm
42
+ RUN npm install -g pnpm && \
43
+ pnpm version
44
+
44
45
  # install jdk 12
45
46
  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 && \
46
47
  tar xvf openjdk12.tar.gz && \
47
48
  rm openjdk12.tar.gz && \
48
- sudo mv jdk-12.0.2 /opt/ && \
49
- sudo rm /opt/jdk-12.0.2/lib/src.zip
49
+ mv jdk-12.0.2 /opt/ && \
50
+ rm /opt/jdk-12.0.2/lib/src.zip
50
51
  ENV JAVA_HOME=/opt/jdk-12.0.2
51
52
  ENV PATH=$PATH:$JAVA_HOME/bin
52
53
  RUN java -version
53
54
 
54
55
  # install rebar3
55
56
  RUN curl -o rebar3 https://s3.amazonaws.com/rebar3/rebar3 && \
56
- sudo chmod +x rebar3 && \
57
- sudo mv rebar3 /usr/local/bin/rebar3
57
+ chmod +x rebar3 && \
58
+ mv rebar3 /usr/local/bin/rebar3
58
59
 
59
60
  # install and update python and python-pip
60
- RUN apt-get install -y python python-pip python3-pip && \
61
- python3 -m pip install pip==$PIP3_INSTALL_VERSION --upgrade && \
62
- python -m pip install pip==$PIP_INSTALL_VERSION --upgrade --force
61
+ RUN apt -q update && apt install -y python3-pip && \
62
+ rm -rf /var/lib/apt/lists/* && \
63
+ python3 -m pip install pip==$PIP3_INSTALL_VERSION --upgrade
63
64
 
64
65
  # install maven
65
- RUN curl -O https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && \
66
- tar -xf apache-maven-$MAVEN_VERSION-bin.tar.gz; rm -rf apache-maven-$MAVEN_VERSION-bin.tar.gz && \
67
- mv apache-maven-$MAVEN_VERSION /usr/local/lib/maven && \
68
- ln -s /usr/local/lib/maven/bin/mvn /usr/local/bin/mvn
66
+ RUN apt -q update && apt install -y maven && \
67
+ rm -rf /var/lib/apt/lists/*
69
68
 
70
69
  # install sbt
71
70
  RUN mkdir -p /usr/local/share/sbt-launcher-packaging && \
72
- curl --progress \
71
+ curl \
73
72
  --retry 3 \
74
73
  --retry-delay 15 \
75
74
  --location "https://github.com/sbt/sbt/releases/download/v${SBT_VERSION}/sbt-${SBT_VERSION}.tgz" \
@@ -95,18 +94,32 @@ ENV PATH=$PATH:/go/bin
95
94
  ENV GOROOT=/go
96
95
  ENV GOPATH=/gopath
97
96
  ENV PATH=$PATH:$GOPATH/bin
97
+
98
98
  RUN mkdir /gopath && \
99
- go get github.com/tools/godep && \
100
- go get github.com/FiloSottile/gvt && \
101
- go get github.com/Masterminds/glide && \
102
- go get github.com/kardianos/govendor && \
103
- go get github.com/golang/dep/cmd/dep && \
104
- go get -u github.com/rancher/trash && \
105
- go clean -cache
99
+ go install github.com/tools/godep@latest && \
100
+ go install github.com/FiloSottile/gvt@latest && \
101
+ go install github.com/kardianos/govendor@latest && \
102
+ go clean -cache
103
+
104
+ #install rvm and glide
105
+ RUN apt-add-repository -y ppa:rael-gc/rvm && \
106
+ apt -q update && apt install -y rvm && \
107
+ /usr/share/rvm/bin/rvm install --default $RUBY_VERSION && \
108
+ apt install -y golang-glide && \
109
+ rm -rf /var/lib/apt/lists/*
110
+
111
+ # install trash
112
+ RUN curl -Lo trash.tar.gz https://github.com/rancher/trash/releases/download/v0.2.7/trash-linux_amd64.tar.gz && \
113
+ tar xvf trash.tar.gz && \
114
+ rm trash.tar.gz && \
115
+ mv trash /usr/local/bin/
116
+
117
+ # install bundler
118
+ RUN bash -lc "gem update --system && gem install bundler"
106
119
 
107
120
  WORKDIR /tmp
108
121
  # Fix the locale
109
- RUN apt-get install -y locales
122
+ RUN apt -q update && apt install -y locales && rm -rf /var/lib/apt/lists/*
110
123
  RUN locale-gen en_US.UTF-8
111
124
  ENV LANG=en_US.UTF-8
112
125
  ENV LANGUAGE=en_US:en
@@ -115,57 +128,49 @@ ENV LC_ALL=en_US.UTF-8
115
128
  # install Cargo
116
129
  RUN curl https://sh.rustup.rs -sSf | bash -ls -- -y --profile minimal
117
130
 
118
- #install rvm
119
- RUN apt-add-repository -y ppa:rael-gc/rvm && \
120
- apt update && apt install -y rvm && \
121
- /usr/share/rvm/bin/rvm install --default $RUBY_VERSION
122
-
123
- # install bundler
124
- RUN bash -lc "gem update --system && gem install bundler"
125
-
126
131
  #install mix
127
- RUN wget https://packages.erlang-solutions.com/erlang-solutions_${MIX_VERSION}_all.deb && \
128
- sudo dpkg -i erlang-solutions_${MIX_VERSION}_all.deb && \
129
- sudo rm -f erlang-solutions_${MIX_VERSION}_all.deb && \
130
- sudo apt-get update && \
131
- sudo apt-get install -y esl-erlang && \
132
- sudo apt-get install -y elixir
132
+ RUN curl -1sLf 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/setup.deb.sh' | bash
133
+ RUN apt -q update && apt install -y erlang && rm -rf /var/lib/apt/lists/*
134
+ # Install Elixir
135
+ WORKDIR /tmp/elixir-build
136
+ RUN git clone https://github.com/elixir-lang/elixir.git
137
+ WORKDIR elixir
138
+ RUN make && make install
139
+ WORKDIR /
133
140
 
134
141
  # install conan
135
- RUN apt-get install -y python-dev && \
136
- pip install --no-cache-dir --ignore-installed six --ignore-installed colorama \
137
- --ignore-installed requests --ignore-installed chardet \
138
- --ignore-installed urllib3 \
139
- --upgrade setuptools && \
140
- pip install --no-cache-dir -Iv conan==1.43.0 && \
142
+ RUN apt -q update && apt install -y python3-dev && rm -rf /var/lib/apt/lists/* && \
143
+ pip install --no-cache-dir --ignore-installed six --ignore-installed colorama \
144
+ --ignore-installed requests --ignore-installed chardet \
145
+ --ignore-installed urllib3 \
146
+ --upgrade setuptools && \
147
+ pip3 install --no-cache-dir -Iv conan==1.51.3 && \
141
148
  conan config install https://github.com/conan-io/conanclientcert.git
142
149
 
143
-
144
150
  # install NuGet (w. mono)
145
151
  # https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools#macoslinux
146
152
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&\
147
- echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list &&\
148
- apt-get update &&\
149
- apt-get install -y mono-complete &&\
150
- curl -o "/usr/local/bin/nuget.exe" "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" &&\
151
- curl -o "/usr/local/bin/nugetv3.5.0.exe" "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe"
153
+ echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list &&\
154
+ apt -q update && apt install -y mono-complete && rm -rf /var/lib/apt/lists/* &&\
155
+ curl -o "/usr/local/bin/nuget.exe" "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" &&\
156
+ curl -o "/usr/local/bin/nugetv3.5.0.exe" "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe"
152
157
 
153
158
  # install dotnet core
154
- RUN wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb &&\
155
- sudo dpkg -i packages-microsoft-prod.deb &&\
156
- rm packages-microsoft-prod.deb &&\
157
- sudo apt-get update &&\
158
- 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
159
+ RUN wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb &&\
160
+ dpkg -i packages-microsoft-prod.deb &&\
161
+ rm packages-microsoft-prod.deb &&\
162
+ apt -q update &&\
163
+ apt install -y dotnet-sdk-6.0 dotnet-sdk-7.0 &&\
164
+ rm -rf /var/lib/apt/lists/*
159
165
 
160
166
  # install Composer
161
167
  # The ARG and ENV are for installing tzdata which is part of this installaion.
162
168
  # https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
163
169
  ENV TZ=GMT
164
170
  RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5267A6C &&\
165
- echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/php.list &&\
166
- apt-get update &&\
171
+ echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" | tee /etc/apt/sources.list.d/php.list &&\
167
172
  export DEBIAN_FRONTEND=noninteractive &&\
168
- apt-get install -y php7.4-cli &&\
173
+ apt -q update && apt install -y php7.4-cli && rm -rf /var/lib/apt/lists/* &&\
169
174
  EXPECTED_COMPOSER_INSTALLER_CHECKSUM="$(curl --silent https://composer.github.io/installer.sig)" &&\
170
175
  php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &&\
171
176
  ACTUAL_COMPOSER_INSTALLER_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" &&\
@@ -178,60 +183,43 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4F4EA0AAE5
178
183
  # See https://docs.conda.io/en/latest/miniconda_hashes.html
179
184
  # for latest versions and SHAs.
180
185
  RUN \
181
- conda_installer=Miniconda3-py38_4.9.2-Linux-x86_64.sh &&\
182
- ref='1314b90489f154602fd794accfc90446111514a5a72fe1f71ab83e07de9504a7' &&\
183
- wget -q https://repo.anaconda.com/miniconda/${conda_installer} &&\
184
- sha=`openssl sha256 "${conda_installer}" | cut -d' ' -f2` &&\
185
- ([ "$sha" = "${ref}" ] || (echo "Verification failed: ${sha} != ${ref}"; false)) &&\
186
- (echo; echo "yes") | sh "${conda_installer}"
186
+ conda_installer=Miniconda3-py38_4.9.2-Linux-x86_64.sh &&\
187
+ ref='1314b90489f154602fd794accfc90446111514a5a72fe1f71ab83e07de9504a7' &&\
188
+ wget -q https://repo.anaconda.com/miniconda/${conda_installer} &&\
189
+ sha=`openssl sha256 "${conda_installer}" | cut -d' ' -f2` &&\
190
+ ([ "$sha" = "${ref}" ] || (echo "Verification failed: ${sha} != ${ref}"; false)) &&\
191
+ (echo; echo "yes") | sh "${conda_installer}"
187
192
 
188
193
  # install Swift Package Manager
189
- # Based on https://github.com/apple/swift-docker/blob/main/5.3/ubuntu/18.04/Dockerfile
194
+ # Based on https://github.com/apple/swift-docker/blob/main/5.8/ubuntu/22.04/Dockerfile
190
195
  # The GPG download steps has been modified. Keys are now on LF repo and copied instaad of downloaded.
191
196
  # Refer to https://swift.org/download/#using-downloads in the Linux section on how to download the keys
192
- RUN apt-get -q install -y \
193
- libatomic1 \
194
- libcurl4 \
195
- libxml2 \
196
- libedit2 \
197
- libsqlite3-0 \
198
- libc6-dev \
197
+ RUN apt -q update && apt -q install -y \
199
198
  binutils \
200
- libgcc-5-dev \
201
- libstdc++-5-dev \
202
- zlib1g-dev \
203
- libpython2.7 \
204
- tzdata \
205
199
  git \
200
+ gnupg2 \
201
+ libc6-dev \
202
+ libedit2 \
203
+ libgcc-9-dev \
204
+ libcurl4-openssl-dev \
205
+ libpython3-dev \
206
+ libsqlite3-0 \
207
+ libstdc++-9-dev \
208
+ libxml2-dev \
209
+ libz3-dev \
206
210
  pkg-config \
211
+ python3-lldb-13 \
212
+ tzdata \
213
+ zlib1g-dev \
207
214
  && rm -r /var/lib/apt/lists/*
208
215
 
209
- #install flutter
210
- ENV FLUTTER_HOME=/root/flutter
211
- RUN curl -o flutter_linux_2.8.1-stable.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_2.8.1-stable.tar.xz \
212
- && tar xf flutter_linux_2.8.1-stable.tar.xz \
213
- && mv flutter ${FLUTTER_HOME} \
214
- && rm flutter_linux_2.8.1-stable.tar.xz
215
-
216
- ENV PATH=$PATH:${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin
217
- RUN flutter doctor -v \
218
- && flutter update-packages \
219
- && flutter precache
220
- # Accepting all licences
221
- RUN yes | flutter doctor --android-licenses -v
222
- # Creating Flutter sample projects to put binaries in cache fore each template type
223
- RUN flutter create --template=app ${TEMP}/app_sample \
224
- && flutter create --template=package ${TEMP}/package_sample \
225
- && flutter create --template=plugin ${TEMP}/plugin_sample
226
-
227
-
228
216
  # pub 4096R/ED3D1561 2019-03-22 [SC] [expires: 2023-03-23]
229
217
  # Key fingerprint = A62A E125 BBBF BB96 A6E0 42EC 925C C1CC ED3D 1561
230
218
  # uid Swift 5.x Release Signing Key <swift-infrastructure@swift.org
231
219
  ARG SWIFT_SIGNING_KEY=A62AE125BBBFBB96A6E042EC925CC1CCED3D1561
232
- ARG SWIFT_PLATFORM=ubuntu18.04
233
- ARG SWIFT_BRANCH=swift-5.3.3-release
234
- ARG SWIFT_VERSION=swift-5.3.3-RELEASE
220
+ ARG SWIFT_PLATFORM=ubuntu22.04
221
+ ARG SWIFT_BRANCH=swift-5.8-release
222
+ ARG SWIFT_VERSION=swift-5.8-RELEASE
235
223
  ARG SWIFT_WEBROOT=https://download.swift.org
236
224
 
237
225
  ENV SWIFT_SIGNING_KEY=$SWIFT_SIGNING_KEY \
@@ -247,7 +235,7 @@ RUN set -e; \
247
235
  && SWIFT_SIG_URL="$SWIFT_BIN_URL.sig" \
248
236
  # - Grab curl here so we cache better up above
249
237
  && export DEBIAN_FRONTEND=noninteractive \
250
- && apt-get -q update && apt-get -q install -y curl && rm -rf /var/lib/apt/lists/* \
238
+ && apt -q update && apt -q install -y curl && rm -rf /var/lib/apt/lists/* \
251
239
  # - Download the GPG keys, Swift toolchain, and toolchain signature, and verify.
252
240
  && export GNUPGHOME="$(mktemp -d)" \
253
241
  && curl -fsSL "$SWIFT_BIN_URL" -o swift.tar.gz "$SWIFT_SIG_URL" -o swift.tar.gz.sig \
@@ -259,6 +247,25 @@ RUN set -e; \
259
247
  && rm -rf "$GNUPGHOME" swift.tar.gz.sig swift.tar.gz \
260
248
  set +e
261
249
 
250
+ # install flutter
251
+ ENV FLUTTER_HOME=/root/flutter
252
+ RUN git config --global --add safe.directory /root/flutter
253
+ RUN curl -o flutter_linux_2.8.1-stable.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_2.8.1-stable.tar.xz \
254
+ && tar xf flutter_linux_2.8.1-stable.tar.xz \
255
+ && mv flutter ${FLUTTER_HOME} \
256
+ && rm flutter_linux_2.8.1-stable.tar.xz
257
+
258
+ ENV PATH=$PATH:${FLUTTER_HOME}/bin:${FLUTTER_HOME}/bin/cache/dart-sdk/bin
259
+ RUN flutter doctor -v \
260
+ && flutter update-packages \
261
+ && flutter precache
262
+ # Accepting all licences
263
+ RUN yes | flutter doctor --android-licenses -v
264
+ # Creating Flutter sample projects to put binaries in cache fore each template type
265
+ RUN flutter create --template=app ${TEMP}/app_sample \
266
+ && flutter create --template=package ${TEMP}/package_sample \
267
+ && flutter create --template=plugin ${TEMP}/plugin_sample
268
+
262
269
  # install license_finder
263
270
  COPY . /LicenseFinder
264
271
  RUN bash -lc "cd /LicenseFinder && bundle config set no-cache 'true' && bundle install -j4 && bundle pristine && rake install"
data/README.md CHANGED
@@ -3,11 +3,10 @@
3
3
  [![Code Climate](https://codeclimate.com/github/pivotal/LicenseFinder.png)](https://codeclimate.com/github/pivotal/LicenseFinder)
4
4
 
5
5
  Build status
6
- * 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)
7
- * 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)
8
- * Ruby 2.6.9 [![Ruby 2.6.9 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.6.9/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
9
- * Ruby 2.7.5 [![Ruby 2.7.5 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.7.5/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
10
- * Ruby 3.1.1 [![Ruby 3.1.1 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-3.1.1/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
6
+ * Ruby 2.7.8 [![Ruby 2.7.8 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-2.7.8/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
7
+ * Ruby 3.1.4 [![Ruby 3.1.4 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-3.1.4/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
8
+ * Ruby 3.2.3 [![Ruby 3.2.3 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-3.2.3/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
9
+ * Ruby 3.3.0 [![Ruby 3.3.0 build status](https://norsk.cf-app.com/api/v1/teams/main/pipelines/LicenseFinder/jobs/ruby-3.3.0/badge)](https://norsk.cf-app.com/teams/main/pipelines/LicenseFinder)
11
10
 
12
11
 
13
12
  LicenseFinder works with your package managers to find dependencies,
@@ -57,8 +56,19 @@ and give you an actionable exception report.
57
56
 
58
57
  ## Installation
59
58
 
60
- License Finder requires Ruby 2.4.0 or greater to run. If you have an older
61
- version of Ruby installed, you can update via Homebrew:
59
+ License Finder may be run as a [pre-commit](https://pre-commit.com) hook by
60
+ adding the following to your `.pre-commit-config.yaml`:
61
+
62
+ ```yaml
63
+ repos:
64
+ - repo: https://github.com/pivotal/LicenseFinder
65
+ rev: v7.1.0 # You probably want the latest tag.
66
+ hooks:
67
+ - id: license-finder
68
+ ```
69
+
70
+ Running License Finder directly requires Ruby 2.6.0 or greater. If you have an
71
+ older version of Ruby installed, you can update via Homebrew:
62
72
 
63
73
  ```sh
64
74
  $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@@ -70,7 +80,7 @@ then:
70
80
  $ brew install ruby
71
81
  ```
72
82
 
73
- The easiest way to use `license_finder` is to install it as a command
83
+ The easiest way to use `license_finder` directly is to install it as a command
74
84
  line tool, like brew, awk, gem or bundler:
75
85
 
76
86
  ```sh
@@ -154,7 +164,8 @@ $ dlf "bundle install && license_finder"
154
164
 
155
165
  You can better understand the way this script works by looking at its source, but for
156
166
  reference it will mount your current directory at the path `/scan` and run any commands
157
- passed to it from that directory.
167
+ passed to it from that directory. If your command has `&&`, ensure you quote the command.
168
+ If it does not, ensure the command is not quoted.
158
169
 
159
170
  Note that the docker image will run the gem which is installed within it.
160
171
  So the docker image tagged `7.0.0` will run *License Finder Version 7.0.0*
@@ -195,7 +206,7 @@ languages, as long as that language has a package definition in the project dire
195
206
  * `build.sbt` file (for `sbt`)
196
207
  * `Cargo.lock` file (for `cargo`)
197
208
  * `composer.lock` file (for `composer`)
198
- * `environment,yml` file (for `conda`)
209
+ * `environment.yml` file (for `conda`)
199
210
  * `pubspec.yaml & .pub cache locaton through ENV variable` (for `flutter`)
200
211
 
201
212
  ### Continuous Integration
@@ -333,12 +344,40 @@ you should manually research what the actual license is. When you
333
344
  have established the real license, you can record it with:
334
345
 
335
346
  ```sh
336
- $ license_finder licenses add my_unknown_dependency MIT --homepage="www.unknown-code.org"
347
+ $ license_finder licenses add my_unknown_dependency MIT
348
+ ```
349
+
350
+ This command would assign the MIT license to all versions of the dependency
351
+ `my_unknown_dependency`. If you prefer, you could instead assign the license
352
+ to only a specific version of the dependency:
353
+
354
+ ```sh
355
+ $ license_finder licenses add my_unknown_dependency MIT --version=1.0.0
337
356
  ```
338
357
 
339
- This command would assign the MIT license to the dependency
340
- `my_unknown_dependency`. It will also set its homepage to `www.unknown-code.org`.
358
+ Please note that adding a license to a specific version of a dependency will
359
+ cause any licenses previously added to all versions of that dependency to be
360
+ forgotten. Similarly, adding a license to all versions of a dependency will
361
+ override any licenses previously added to specific versions of that dependency.
362
+
363
+ There are several ways in which you can remove licenses that were previously
364
+ added through the `licenses add` command:
365
+
366
+ ```sh
367
+ # Removes all licenses from any version of the dependency
368
+ $ license_finder licenses remove my_unknown_dependency
341
369
 
370
+ # Removes just the MIT license from any version of the dependency
371
+ $ license_finder licenses remove my_unknown_dependency MIT
372
+
373
+ # Removes all licenses from only version 1.0.0 of the dependency
374
+ # This has no effect if you had last added a license to all versions of the dependency
375
+ $ license_finder licenses remove my_unknown_dependency --version=1.0.0
376
+
377
+ # Removes just the MIT license from only version 1.0.0 of the dependency
378
+ # This has no effect if you had last added a license to all versions of the dependency
379
+ $ license_finder licenses remove my_unknown_dependency MIT --version=1.0.0
380
+ ```
342
381
 
343
382
  ### Adding Hidden Dependencies
344
383
 
@@ -502,7 +541,7 @@ licenseConfigurations := Set("compile", "provided")
502
541
 
503
542
  ## Requirements
504
543
 
505
- `license_finder` requires ruby >= 2.4.0. We will be dropping 2.4.x support soon.
544
+ `license_finder` requires ruby >= 2.6.0.
506
545
 
507
546
 
508
547
  ## Upgrading
data/Rakefile CHANGED
@@ -54,7 +54,7 @@ task :update_pipeline, [:slack_url, :slack_channel] do |_, args|
54
54
  puts 'Warning: You should provide slack channel and url to receive slack notifications on build failures'
55
55
  end
56
56
 
57
- ruby_versions = %w[3.1.1 2.7.5 2.6.9 2.5.7 2.4.9]
57
+ ruby_versions = %w[3.3.0 3.2.3 3.1.4 2.7.8]
58
58
 
59
59
  params = []
60
60
  params << "ruby_versions=#{ruby_versions.join(',')}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.1
1
+ 7.2.0