Dagger
Search

golangcilint

No long description provided.

Installation

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

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.
Example
dagger -m github.com/papercomputeco/daggerverse/golangcilint@aea9795251216b4861c87d41ba2cd3ff0c07551c 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 🔗

source() 🔗

Source is the Go source directory to lint.

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

config() 🔗

Config is an optional golangci-lint configuration file. When provided it overrides the opinionated default config that ships with this module.

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

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@aea9795251216b4861c87d41ba2cd3ff0c07551c 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@aea9795251216b4861c87d41ba2cd3ff0c07551c 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()
}