Licenses
gspot add licenses adds a check that runs before each push and reads the lockfiles of each scope:
| Check | Stage | Level | What it does |
|---|---|---|---|
licenses/allowed |
push |
basic |
Compares the license of each locked package with the allowed list and package records, through osv-scanner. |
The check sends the names and versions of your locked packages to the deps.dev service, so it needs network access and a lockfile. It skips until you list the licenses that your project accepts:
gspot set licenses.allowed MIT Apache-2.0 BSD-3-Clausegspot check --only licenses/allowedAllow one package
Section titled “Allow one package”To allow one package version whose license you reviewed, add a [[licenses.allowed_package]] record, and name the license
in the reason:
[[licenses.allowed_package]]name = "colorama"version = "0.4.6"reason = "BSD. Installed metadata reports the reviewed BSD license in its short form."version takes an exact version, a version range such as ^1.2.0, or * for any version. For a package with one build
for each platform, name takes a glob pattern:
[[licenses.allowed_package]]name = "@img/sharp-libvips-*"version = "*"reason = "LGPL-3.0-or-later. sharp loads the library as a separate file."gspot reports a record that matches no package in the lockfile. A finding points at the line of its package in the
lockfile, so an [[ignore]] for this check names the lockfile in its paths. An ignore whose paths name another file,
such as pyproject.toml, covers nothing, and the check reports it as unmatched-ignore. Python package names match the way pip matches them:
letter case and runs of ., _, and - do not matter.