Skip to content

Commit

Permalink
ci: run linting over ci itself
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc committed May 1, 2024
1 parent 4dcc845 commit e27ae07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions ci/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ func (e *Engine) Lint(
// +optional
all bool,
) error {
eg, ctx := errgroup.WithContext(ctx)
src := e.Dagger.Source.AsModule().GeneratedContextDirectory()

pkgs := []string{""}
// pkgs := []string{"", "ci"}
eg, ctx := errgroup.WithContext(ctx)

pkgs := []string{"", "ci"}
cmd := []string{"golangci-lint", "run", "-v", "--timeout", "5m"}
if all {
cmd = append(cmd, "--max-issues-per-linter=0", "--max-same-issues=0")
}
for _, pkg := range pkgs {
golangci := dag.Container().
From(consts.GolangLintImage).
WithMountedDirectory("/app", util.GoDirectory(e.Dagger.Source)).
WithMountedDirectory("/app", util.GoDirectory(src)).
WithWorkdir(path.Join("/app", pkg)).
WithExec(cmd)
eg.Go(func() error {
Expand All @@ -145,8 +145,8 @@ func (e *Engine) Lint(
})

eg.Go(func() error {
return util.DiffDirectoryF(ctx, util.GoDirectory(e.Dagger.Source), func(ctx context.Context) (*dagger.Directory, error) {
return util.GoBase(e.Dagger.Source).
return util.DiffDirectoryF(ctx, util.GoDirectory(src), func(ctx context.Context) (*dagger.Directory, error) {
return util.GoBase(src).
WithExec([]string{"go", "mod", "tidy"}).
Directory("."), nil
}, "go.mod", "go.sum")
Expand Down
10 changes: 5 additions & 5 deletions ci/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ import (
// A dev environment for the official Dagger SDKs
type SDK struct {
// Develop the Dagger Go SDK
Go *GoSDK
Go *GoSDK
// Develop the Dagger Python SDK
Python *PythonSDK
Python *PythonSDK
// Develop the Dagger Typescript SDK
Typescript *TypescriptSDK

// Develop the Dagger Elixir SDK (experimental)
Elixir *ElixirSDK
// Develop the Dagger Rust SDK (experimental)
Rust *RustSDK
Rust *RustSDK
// Develop the Dagger Java SDK (experimental)
Java *JavaSDK
Java *JavaSDK
// Develop the Dagger PHP SDK (experimental)
PHP *PHPSDK
PHP *PHPSDK
}

func (ci *Dagger) installer(ctx context.Context, name string) (func(*Container) *Container, error) {
Expand Down

0 comments on commit e27ae07

Please sign in to comment.