Skip to content

Commit cf11334

Browse files
authored
Merge pull request #27 from github/elr/refactor-to-spdxexp
rename package from expression to spdxexp
2 parents 82503af + 9374645 commit cf11334

16 files changed

+33
-21
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
Golang implementation of a checker for determining if a set of SPDX IDs satisfies an SPDX Expression.
44

5+
## Installation
6+
7+
There are several ways to include a go package. To download and install, you can use `go get`. The command for that is:
8+
9+
```sh
10+
go get github.com/github/go-spdx@latest
11+
```
12+
13+
## Packages
14+
15+
- [spdxexp](https://pkg.go.dev/github.com/github/go-spdx/spdxexp) - Expression package validates licenses and determines if a license expression is satisfied by a list of licenses. Validity of a license is determined by the SPDX license list.
16+
517
## Public API
618

719
_NOTE: The public API is initially limited to the Satisfies and ValidateLicenses functions. If

expression/doc.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

expression/compare.go renamed to spdxexp/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
func compareGT(first *node, second *node) bool {
44
if !first.isLicense() || !second.isLicense() {

expression/compare_test.go renamed to spdxexp/compare_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"testing"

spdxexp/doc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
Spdxexp package validates licenses and determines if a license expression is satisfied by a list of licenses.
3+
Validity of a license is determined by the [SPDX license list].
4+
5+
[SPDX license list]: https://spdx.org/licenses/
6+
*/
7+
package spdxexp

expression/license.go renamed to spdxexp/license.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"strings"

expression/license_test.go renamed to spdxexp/license_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"testing"

expression/node.go renamed to spdxexp/node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"sort"
@@ -167,7 +167,7 @@ func (n *node) reconstructedLicenseString() *string {
167167
return nil
168168
}
169169

170-
// Sort an array of license and license reference nodes alphebetically based
170+
// Sort an array of license and license reference nodes alphabetically based
171171
// on their reconstructedLicenseString() representation. The sort function does not expect
172172
// expression nodes, but if one is in the nodes list, it will sort to the end.
173173
func sortLicenses(nodes []*node) {

expression/node_test.go renamed to spdxexp/node_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"testing"

expression/parse.go renamed to spdxexp/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"errors"

expression/parse_test.go renamed to spdxexp/parse_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"errors"

expression/satisfies.go renamed to spdxexp/satisfies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"errors"

expression/satisfies_test.go renamed to spdxexp/satisfies_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"errors"

expression/scan.go renamed to spdxexp/scan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
/* Translation to Go from javascript code: https://github.com/clearlydefined/spdx-expression-parse.js/blob/master/scan.js */
44

expression/scan_test.go renamed to spdxexp/scan_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
import (
44
"errors"

expression/test_helper.go renamed to spdxexp/test_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package expression
1+
package spdxexp
22

33
// getLicenseNode is a test helper method that is expected to create a valid
44
// license node. Use this function when the test data is known to be a valid

0 commit comments

Comments
 (0)