Skip to content

Commit

Permalink
fix(report): changed from reporting to report
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Sep 17, 2022
1 parent 9f4a11c commit 5683163
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ coverage.txt
package-lock.json
node_modules/*
results.yaml
.vscode/*
.vscode/*
report.md
1 change: 1 addition & 0 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (

func initialisePlugins(configuration commons.Config) error {
for _, plugins := range configuration.Plugins {

plugins.Validate()
if *install {
_, err := plugins.Install()
Expand Down
7 changes: 5 additions & 2 deletions plugins/commons/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ func (c *Plugin) Validate() error {
return fmt.Errorf("plugin `%s`: `source` attribute cannot be omitted when specifying `version`", c.Name)
}

if c.Type != "checks" && c.Type != "" && c.Type != "reporting" && c.Type != "mod" {
if c.Type != "checks" && c.Type != "" && c.Type != "report" && c.Type != "mod" {
return fmt.Errorf("plugin `%s`: `type` attribute must be either `checks` or `reporting` or `mod`", c.Name)
}

if c.Source != "" {
if c.Version == "" {
return fmt.Errorf("plugin `%s`: `version` attribute cannot be omitted when specifying `source`", c.Name)
Expand All @@ -76,6 +75,7 @@ func (c *Plugin) Validate() error {
}
c.SourceOwner = parts[1]
c.SourceRepo = parts[2]

}

return nil
Expand All @@ -93,6 +93,9 @@ func (c *Plugin) Install() (string, error) {
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
return "", fmt.Errorf("failed to mkdir to %s: %w", filepath.Dir(path), err)
}
fmt.Println("GOGOGOGOG", c.SourceOwner, c.SourceRepo, c.TagName())
c.Validate()
fmt.Println("GOGOGOGOG", c.SourceOwner, c.SourceRepo, c.TagName())

assets, err := c.fetchReleaseAssets()
if err != nil {
Expand Down

0 comments on commit 5683163

Please # to comment.