This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
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.
Merge pull request #17 from openmeterio/rename-example
Rename example
- Loading branch information
Showing
9 changed files
with
82 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
|
||
"golang.org/x/sync/errgroup" | ||
) | ||
|
||
// Run various linters against the source code. | ||
func (m *Ci) Lint() *Lint { | ||
return &Lint{ | ||
Source: m.Source, | ||
} | ||
} | ||
|
||
type Lint struct { | ||
// +private | ||
Source *Directory | ||
} | ||
|
||
func (m *Lint) All(ctx context.Context) error { | ||
var group errgroup.Group | ||
|
||
group.Go(func() error { | ||
_, err := m.Go().Sync(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}) | ||
|
||
group.Go(func() error { | ||
_, err := m.Helm().Sync(ctx) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}) | ||
|
||
return group.Wait() | ||
} | ||
|
||
func (m *Lint) Go() *Container { | ||
return dag.GolangciLint(GolangciLintOpts{ | ||
Version: golangciLintVersion, | ||
GoVersion: goVersion, | ||
}). | ||
Run(m.Source, GolangciLintRunOpts{ | ||
Verbose: true, | ||
}) | ||
} | ||
|
||
func (m *Lint) Helm() *Container { | ||
return dag.Helm(HelmOpts{Version: helmVersion}).Lint(helmChartDir(m.Source)) | ||
} |
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
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