Dagger
Search

golangcilint

No long description provided.

Installation

dagger install github.com/papercomputeco/daggerverse/golangcilint@8646f8127d0bb464437e12f0a5d83d72edc211d8

Entrypoint

Return Type
Golangcilint !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-The Go source directory to lint.
configFile -An optional golangci-lint configuration file (.golangci.yml) that replaces the built-in opinionated defaults.
envVars[String ! ] -Optional environment variables to set in the lint container. Each entry must be in "KEY=VALUE" format (e.g. "GOEXPERIMENT=rangefunc").
baseCtrContainer -Optional base container with golangci-lint already installed. When provided it replaces the default golangci-lint image, allowing callers to supply extra system libraries or tooling (e.g. sqlite-dev). The container must have golangci-lint on PATH.
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@8646f8127d0bb464437e12f0a5d83d72edc211d8 call \
 --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Golangcilint  {
	return dag.
			Golangcilint(source)
}
@function
def example(source: dagger.Directory, ) -> dagger.Golangcilint:
	return (
		dag.golangcilint(source)
	)
@func()
example(source: Directory, ): Golangcilint {
	return dag
		.golangcilint(source)
}

Types

Golangcilint 🔗

lint() 🔗

Lint runs golangci-lint on the source directory with –fix, applying auto-fixes where possible, and returns the directory with fixes applied.

Return Type
Directory !
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@8646f8127d0bb464437e12f0a5d83d72edc211d8 call \
 --source DIR_PATH lint
func (m *MyModule) Example(source *dagger.Directory) *dagger.Directory  {
	return dag.
			Golangcilint(source).
			Lint()
}
@function
def example(source: dagger.Directory, ) -> dagger.Directory:
	return (
		dag.golangcilint(source)
		.lint()
	)
@func()
example(source: Directory, ): Directory {
	return dag
		.golangcilint(source)
		.lint()
}

check() 🔗

Check runs golangci-lint on the source directory without applying fixes. It returns the linter output as a string. If there are lint violations the Dagger pipeline will fail, making this suitable for CI checks.

Return Type
String !
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@8646f8127d0bb464437e12f0a5d83d72edc211d8 call \
 --source DIR_PATH check
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			Golangcilint(source).
			Check(ctx)
}
@function
async def example(source: dagger.Directory, ) -> str:
	return await (
		dag.golangcilint(source)
		.check()
	)
@func()
async example(source: Directory, ): Promise<string> {
	return dag
		.golangcilint(source)
		.check()
}