Skip to content

Commit

Permalink
Merge pull request #45 from pmonks/dev
Browse files Browse the repository at this point in the history
Release 2.0.200
  • Loading branch information
pmonks committed Mar 27, 2024
2 parents 37637a6 + 5ecc325 commit 3113ddc
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
distribution: 'temurin'
java-version: 21
- uses: DeLaGuardo/setup-clojure@12.1
- uses: DeLaGuardo/setup-clojure@12.5
with:
cli: latest
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: deploy
on:
push:
branches:
- main
- release

jobs:
deploy:
Expand All @@ -17,10 +17,10 @@ jobs:
with:
distribution: 'temurin'
java-version: 21
- uses: DeLaGuardo/setup-clojure@12.1
- uses: DeLaGuardo/setup-clojure@12.5
with:
cli: latest
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: docs
on:
push:
branches:
- main
- release

jobs:
docs:
Expand All @@ -14,10 +14,10 @@ jobs:
with:
distribution: 'temurin'
java-version: 21
- uses: DeLaGuardo/setup-clojure@12.1
- uses: DeLaGuardo/setup-clojure@12.5
with:
cli: latest
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/vulnerabilities.yml

This file was deleted.

23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
| | | | |
|---:|:---:|:---:|:---:|
| [**main**](https://github.com/pmonks/tools-licenses/tree/main) | [![CI](https://github.com/pmonks/tools-licenses/workflows/CI/badge.svg?branch=main)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3ACI+branch%3Amain) | [![Dependencies](https://github.com/pmonks/tools-licenses/workflows/dependencies/badge.svg?branch=main)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3Adependencies+branch%3Amain) | [![Vulnerabilities](https://github.com/pmonks/lice-comb/workflows/vulnerabilities/badge.svg?branch=main)](https://pmonks.github.io/tools-licenses/nvd/dependency-check-report.html) |
| [**dev**](https://github.com/pmonks/tools-licenses/tree/dev) | [![CI](https://github.com/pmonks/tools-licenses/workflows/CI/badge.svg?branch=dev)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3ACI+branch%3Adev) | [![Dependencies](https://github.com/pmonks/tools-licenses/workflows/dependencies/badge.svg?branch=dev)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3Adependencies+branch%3Adev) | [![Vulnerabilities](https://github.com/pmonks/lice-comb/workflows/vulnerabilities/badge.svg?branch=dev)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3Avulnerabilities+branch%3Adev) |
| | | |
|---:|:---:|:---:|
| [**release**](https://github.com/pmonks/tools-licenses/tree/release) | [![CI](https://github.com/pmonks/tools-licenses/actions/workflows/ci.yml/badge.svg?branch=release)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3ACI+branch%3Arelease) | [![Dependencies](https://github.com/pmonks/tools-licenses/actions/workflows/dependencies.yml/badge.svg?branch=release)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3Adependencies+branch%3Arelease) |
| [**dev**](https://github.com/pmonks/tools-licenses/tree/dev) | [![CI](https://github.com/pmonks/tools-licenses/actions/workflows/ci.yml/badge.svg?branch=dev)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3ACI+branch%3Adev) | [![Dependencies](https://github.com/pmonks/tools-licenses/actions/workflows/dependencies.yml/badge.svg?branch=dev)](https://github.com/pmonks/tools-licenses/actions?query=workflow%3Adependencies+branch%3Adev) |

[![Latest Version](https://img.shields.io/clojars/v/com.github.pmonks/tools-licenses)](https://clojars.org/com.github.pmonks/tools-licenses/) [![Open Issues](https://img.shields.io/github/issues/pmonks/tools-licenses.svg)](https://github.com/pmonks/tools-licenses/issues) [![License](https://img.shields.io/github/license/pmonks/tools-licenses.svg)](https://github.com/pmonks/tools-licenses/blob/main/LICENSE)
[![Latest Version](https://img.shields.io/clojars/v/com.github.pmonks/tools-licenses)](https://clojars.org/com.github.pmonks/tools-licenses/) [![License](https://img.shields.io/github/license/pmonks/tools-licenses.svg)](https://github.com/pmonks/tools-licenses/blob/release/LICENSE) [![Open Issues](https://img.shields.io/github/issues/pmonks/tools-licenses.svg)](https://github.com/pmonks/tools-licenses/issues)


# tools-licenses
Expand Down Expand Up @@ -37,12 +37,17 @@ This tool uses the [`lice-comb` library](https://github.com/pmonks/lice-comb), w

* It only scans Maven POM files for license information, and silently ignores projects that don't have license tags in their POM file, or don't have a POM file at all. This is a problem because:
* git dependencies (whose use is encouraged by tools.deps/tools.build) don't need a POM file (and in practice most don't provide one)
* silently ignoring projects that lack a `pom.xml` file (or have one that doesn't contain licensing information) may lull users into a false sense of security vis-a-vis license compliance
* [Clojars only recently started mandating license information in the POM files it hosts](https://github.com/clojars/clojars-web/issues/873), and as of mid-2023 around 1/3 of all projects deployed hosted there do not include any licensing information in their POM files
* It's coupled to tools.deps and cannot easily be consumed as an independent library. It's also dependent on tools.deps state management (e.g. requires POM files to be downloaded locally).
* It doesn't canonicalise license information to SPDX License Expressions (it leaves canonicalisation, a fairly difficult problem, to the caller).

In contrast, `tools-licenses` leverages the [`lice-comb` library](https://github.com/pmonks/lice-comb), a build-tool-agnostic library that takes a more comprehensive approach to license detection.

## Why not [`scarletcomply/license-finder`](https://github.com/scarletcomply/license-finder)?

* It doesnt canonicalise license information to SPDX License Expressons (it leaves canonicalisation, a fairly difficult problem, to the caller).

## I use Leiningen - is something like `tools-licenses` available?

While Leiningen's original [`lein-licenses` plugin](https://github.com/technomancy/lein-licenses) was discontinued some years ago and finally archived in 2020, [JohnnyJayJay has developed an alternative `lein-licenses` plugin](https://github.com/JohnnyJayJay/lein-licenses/) that leverages the same underlying license detection library ([`lice-comb`](https://github.com/pmonks/lice-comb)) as `tools-licenses`, thereby offering similar capabilities.
Expand Down Expand Up @@ -160,17 +165,17 @@ Other invocation possibilities:

## Contributor Information

[Contributing Guidelines](https://github.com/pmonks/tools-licenses/blob/main/.github/CONTRIBUTING.md)
[Contributing Guidelines](https://github.com/pmonks/tools-licenses/blob/release/.github/CONTRIBUTING.md)

[Bug Tracker](https://github.com/pmonks/tools-licenses/issues)

[Code of Conduct](https://github.com/pmonks/tools-licenses/blob/main/.github/CODE_OF_CONDUCT.md)
[Code of Conduct](https://github.com/pmonks/tools-licenses/blob/release/.github/CODE_OF_CONDUCT.md)

### Developer Workflow

This project uses the [git-flow branching strategy](https://nvie.com/posts/a-successful-git-branching-model/), with the caveat that the permanent branches are called `main` and `dev`, and any changes to the `main` branch are considered a release and auto-deployed (JARs to Clojars, API docs to GitHub Pages, etc.).
This project uses the [git-flow branching strategy](https://nvie.com/posts/a-successful-git-branching-model/), and the permanent branches are called `release` and `dev`. Any changes to the `release` branch are considered a release and auto-deployed (JARs to Clojars, API docs to GitHub Pages, etc.).

For this reason, **all development must occur either in branch `dev`, or (preferably) in temporary branches off of `dev`.** All PRs from forked repos must also be submitted against `dev`; the `main` branch is **only** updated from `dev` via PRs created by the core development team. All other changes submitted to `main` will be rejected.
For this reason, **all development must occur either in branch `dev`, or (preferably) in temporary branches off of `dev`.** All PRs from forked repos must also be submitted against `dev`; the `release` branch is **only** updated from `dev` via PRs created by the core development team. All other changes submitted to `release` will be rejected.

### Build Tasks

Expand Down
Binary file modified demo-licenses-explain.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
;

{:deps
{io.github.clojure/tools.build {:mvn/version "0.9.6"}
jansi-clj/jansi-clj {:mvn/version "1.0.3"}
{jansi-clj/jansi-clj {:mvn/version "1.0.3"}
com.github.pmonks/clj-wcwidth {:mvn/version "1.0.85"}
com.github.pmonks/lice-comb {:mvn/version "2.0.247"}
com.github.pmonks/asf-cat {:mvn/version "2.0.116"}
com.github.pmonks/tools-convenience {:mvn/version "1.0.142"}}
com.github.pmonks/lice-comb {:mvn/version "2.0.264"}
com.github.pmonks/asf-cat {:mvn/version "2.0.125"}
com.github.pmonks/tools-convenience {:mvn/version "1.0.151"}}
:aliases
{:build {:deps {com.github.pmonks/pbr {:mvn/version "RELEASE"}
com.github.pmonks/tools-licenses {:local/root "."}}
Expand Down
3 changes: 2 additions & 1 deletion pbr.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
(assoc opts
:lib 'com.github.pmonks/tools-licenses
:version (pbr/calculate-version 2 0)
:prod-branch "release"
:write-pom true
:validate-pom true
:pom {:description "A Clojure tools.build task library related to dependency licenses."
:url "https://github.com/pmonks/tools-licenses"
:licenses [:license {:name "Apache License 2.0" :url "http://www.apache.org/licenses/LICENSE-2.0.html"}]
:licenses [:license {:name "Apache-2.0" :url "http://www.apache.org/licenses/LICENSE-2.0.html"}]
:developers [:developer {:id "pmonks" :name "Peter Monks" :email "pmonks+tools-licenses@gmail.com"}]
:scm {:url "https://github.com/pmonks/tools-licenses" :connection "scm:git:git://github.com/pmonks/tools-licenses.git" :developer-connection "scm:git:ssh://git@github.com/pmonks/tools-licenses.git"}
:issue-management {:system "github" :url "https://github.com/pmonks/tools-licenses/issues"}}))
2 changes: 1 addition & 1 deletion src/tools_licenses/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
:medium (ansi/fg-bright :yellow "medium")
:high (ansi/fg-bright :green "high"))))
(when-let [strategy (:strategy %)] (str (ansi/bold "\n Strategy: ") (get lcu/strategy->string strategy (name strategy))))
(when-let [source (seq (map remove-file-prefix (:source %)))] (str (ansi/bold "\n Source:") "\n " (s/join "\n " source))))
(when-let [source (seq (map remove-file-prefix (:source %)))] (str (ansi/bold "\n Source:") "\n " (s/join "\n " source))))
info-list))))))

(defn- explain-with-licenses!
Expand Down

0 comments on commit 3113ddc

Please sign in to comment.