Dagger
Search

golangcilint

No long description provided.

Installation

dagger install github.com/papercomputeco/daggerverse/golangcilint@86a1d261ab86c7a147ab4def8098484e258f9d96

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").
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@86a1d261ab86c7a147ab4def8098484e258f9d96 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@86a1d261ab86c7a147ab4def8098484e258f9d96 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@86a1d261ab86c7a147ab4def8098484e258f9d96 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()
}