Dagger
Search

golangcilint

No long description provided.

Installation

dagger install github.com/papercomputeco/daggerverse/golangcilint@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2

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@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
func (m *MyModule) Example() *dagger.Golangcilint  {
	return dag.
			Golangcilint()
}
@function
def example() -> dagger.Golangcilint:
	return (
		dag.golangcilint()
	)
@func()
example(): Golangcilint {
	return dag
		.golangcilint()
}

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@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
 lint
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Golangcilint().
			Lint()
}
@function
def example() -> dagger.Directory:
	return (
		dag.golangcilint()
		.lint()
	)
@func()
example(): Directory {
	return dag
		.golangcilint()
		.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@b3469bf3e3d2ec5584b4ec62b33b0dc6243ae5c2 call \
 check
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Golangcilint().
			Check(ctx)
}
@function
async def example() -> str:
	return await (
		dag.golangcilint()
		.check()
	)
@func()
async example(): Promise<string> {
	return dag
		.golangcilint()
		.check()
}