forked from ribice/glice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug that added overrides to list of deletions during
glice audit
- Loading branch information
Mike Schinkel
committed
Oct 21, 2022
1 parent
d98eb52
commit 4cd8c6b
Showing
12 changed files
with
115 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// VerifyCmd represents the Verify command | ||
var VerifyCmd = &cobra.Command{ | ||
Use: "verify", | ||
Run: RunVerify, | ||
Short: "Verify your project's `glice.yaml` file", | ||
Long: "Verify your project's `glice.yaml` file by loading it", | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(VerifyCmd) | ||
} | ||
|
||
func RunVerify(cmd *cobra.Command, args []string) { | ||
ctx := context.Background() | ||
Notef("\n") | ||
LoadingProfileFile(ctx) | ||
Notef("\n\n") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
package glice | ||
|
||
type Overrides []*Override | ||
type OverrideMap map[string]*Override | ||
type Override struct { | ||
DependencyImport string `yaml:"dependency"` | ||
LicenseID string `yaml:"license,omitempty"` | ||
LicenseIDs []string `yaml:"licenses,omitempty"` | ||
VerifiedBy string `yaml:"verifier"` | ||
LastVerified string `yaml:"verified"` | ||
Notes string `yaml:"notes,omitempty"` | ||
Import string `yaml:"dependency"` | ||
LicenseID string `yaml:"license,omitempty"` | ||
LicenseIDs []string `yaml:"licenses,omitempty"` | ||
VerifiedBy string `yaml:"verifier"` | ||
LastVerified string `yaml:"verified"` | ||
Notes string `yaml:"notes,omitempty"` | ||
} | ||
|
||
func NewOverride(dep *Dependency, ed *Editor) *Override { | ||
return &Override{ | ||
DependencyImport: dep.Import, | ||
LicenseID: dep.LicenseID, | ||
LicenseIDs: []string{}, | ||
VerifiedBy: ed.Alias(), | ||
LastVerified: Timestamp()[:10], | ||
Import: dep.Import, | ||
LicenseID: dep.LicenseID, | ||
LicenseIDs: []string{}, | ||
VerifiedBy: ed.Alias(), | ||
LastVerified: Timestamp()[:10], | ||
Notes: "Your dependency-specific notes go here,\n" + | ||
"e.g. links where you read the license you verified, etc.", | ||
} | ||
} | ||
|
||
// ToMap creates a map of Overrides indexed by Dependency Import | ||
func (ors Overrides) ToMap() OverrideMap { | ||
newOrs := make(OverrideMap, len(ors)) | ||
for _, or := range ors { | ||
newOrs[or.Import] = or | ||
} | ||
return newOrs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.