Skip to content

Commit

Permalink
update lint
Browse files Browse the repository at this point in the history
Signed-off-by: bupd <[email protected]>
  • Loading branch information
bupd committed Feb 10, 2025
1 parent 84e397e commit 34b891f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .dagger/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (m *Harbor) LintReport(ctx context.Context) *dagger.File {
return m.lint(ctx).WithExec([]string{
"golangci-lint", "-v", "run", "--timeout=10m",
"--out-format", "github-actions:" + report,
"--issues-exit-code", "1",
"--issues-exit-code", "0",
}).File(report)
}

Expand All @@ -23,14 +23,15 @@ func (m *Harbor) Lint(ctx context.Context) (string, error) {

func (m *Harbor) lint(ctx context.Context) *dagger.Container {
fmt.Println("👀 Running linter.")
m.lintAPIs(ctx)
m.Source = m.genAPIs(ctx)
linter := dag.Container().
From("golangci/golangci-lint:"+GOLANGCILINT_VERSION+"-alpine").
WithMountedCache("/lint-cache", dag.CacheVolume("/lint-cache")).
WithEnvVariable("GOLANGCI_LINT_CACHE", "/lint-cache").
WithMountedDirectory("/harbor", m.Source).
WithWorkdir("/harbor/src").
WithExec([]string{"golangci-lint", "cache", "clean"})
WithWorkdir("/harbor/src")
// WithExec([]string{"golangci-lint", "cache", "clean"})

return linter
}
Expand Down

0 comments on commit 34b891f

Please sign in to comment.