14 Commits

Author SHA1 Message Date
Philip Meulengracht
ae6489f798 golang: remove deadcode linter 2023-03-09 14:43:47 +01:00
Miguel Pires
d097436c1c many: fix formatting w/ gofmt 1.19
Go 1.19 includes some changes to gofmt which intend to make lists and
heading clearer when rendered (https://go.dev/doc/go1.19). This commit
is the result of running the new gofmt and manually fixing some of it.
This was necessary because the new gofmt assumed lines beginning w/ tabs
to start lists or examples. While this is often true in our codebase,
we occasionally also use tabs to indent the lines after a TODO or FIXME
prefix or in yaml (e.g., excerpts of a snap.yaml). This meant that a lot of the
reformatted comments were broken and had to be fixed manually.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-01-16 14:23:11 +01:00
Miguel Pires
615da7771d many: fix failing golangci checks
* Group 3rd party imports
* Remove unused vars
* Move var only used in tests into test
* Add 'nolint' to ignore warning on unused iotas (might've been
left to improve readability).
2022-02-09 10:12:09 +00:00
Miguel Pires
759f0a2fc5 spdx: restore licenses list 2021-08-26 18:37:39 +01:00
Miguel Pires
db9c63b734 many: remove unused code 2021-08-26 18:24:02 +01:00
Maciej Borzecki
cc12dae393 spdx: update to SPDX license list version: 3.11 2020-11-25 (#9629)
Some licenses were missing. Update to the latest version of the SPDX license
list.

Fixes: https://bugs.launchpad.net/snapcraft/+bug/1903609

* spdx: add deprecated license IDs

Some deprecated license IDs may be in common use, eg. GPL-2.0, GPL-3.0.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* spdx: drop implicit handling of 'or-later' licenses

Some licenses had 'or-later' variants, eg. GPL-2.0+. The code would incorrectly
treat such licenses and lics as 'gnuplot+' would validate correctly even though
it is unexpected.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* spdx: add a test case for GPL-2.0++ license

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

* spdx: update to 3.11 2020-11-25 version of license list data

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-01-06 18:17:09 +01:00
John R. Lenton
dfa9cad7ec spdx/parser.go:30:1: only the first constant has an explicit type (SA9004) 2018-11-29 07:39:13 +00:00
Michael Vogt
667752832b spdx: remove "Other Open Source" from the support licenses
This license is not part of spdx and was only added for backward
compatibility. But given that we will use "unset" for unknown
licenses the backward compatibility is not required.
2018-08-28 07:48:05 +02:00
Matias Bordese
135172ee83 spdx: fix for WITH syntax to require a license name before 2017-10-25 11:28:09 -03:00
Michael Vogt
0858503aee handle empty licenses 2017-09-01 18:47:57 +02:00
Michael Vogt
c0e0593b26 add scanner test 2017-09-01 18:21:51 +02:00
Michael Vogt
98c5f571f7 address review feedback (thanks Gustavo) 2017-09-01 18:13:44 +02:00
Michael Vogt
ae2d570b1b fix tests, add two compat store licenses 2017-09-01 14:21:50 +02:00
Michael Vogt
bb04628bc0 add slightly stricter spdx license validation 2017-09-01 13:05:38 +02:00