Skip to content

Commit

Permalink
Merge pull request #4 from bfabio/update
Browse files Browse the repository at this point in the history
chore: update license list
  • Loading branch information
kyoh86 authored Apr 21, 2022
2 parents f105a14 + 981f8eb commit 2f42f2d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ go get github.com/kyoh86/go-spdx

See [example](https://github.com/kyoh86/go-spdx/blob/main/cmd/go-spdx-example/main.go) or [test](https://github.com/kyoh86/go-spdx/blob/main/spdx/parser_test.go)

## Updating licenses

In order to update the licenses_asset.go file with the newest license list from SPDX, execute the following commands:

```
cd spdx
npm install spdx-license-list@latest
make licenses-asset
```

(You should also add a test to spdx/parser_test.go to make sure everything worked as expected.)

# LICENSE

[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg)](http://www.opensource.org/licenses/MIT)
Expand Down
2 changes: 1 addition & 1 deletion spdx/json/licenses.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions spdx/licenses_asset.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions spdx/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion spdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"author": "Kyoichiro Yamada",
"license": "MIT",
"dependencies": {
"spdx-license-list": "^3.0.1"
"spdx-license-list": "^6.5.0"
}
}
6 changes: 6 additions & 0 deletions spdx/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ func TestParse(t *testing.T) {
assert.Equal(t, LicenseID("0BSD"), exp)
})

t.Run("single-license-lgpl-or-later", func(t *testing.T) {
exp, err := Parse("LGPL-3.0-or-later")
assert.NoError(t, err)
assert.Equal(t, LicenseID("LGPL-3.0-or-later"), exp)
})

t.Run("single-license-and-later", func(t *testing.T) {
exp, err := Parse("MPL-2.0+")
assert.NoError(t, err)
Expand Down

0 comments on commit 2f42f2d

Please sign in to comment.