Dagger
Search

shellcheck

ShellCheck is a static analysis tool for shell scripts (sh, bash, dash, ksh)
that finds bugs, syntax issues, and style warnings.

Installation

dagger install github.com/softwaredevelop/daggerverse/shellcheck@efce5bec5854bf0560ae7ecb217436bbe766b817

Entrypoint

Return Type
Shellcheck !
Arguments
NameTypeDefault ValueDescription
imageString -Custom image reference in "repository:tag" format to use as a base container.
Example
dagger -m github.com/softwaredevelop/daggerverse/shellcheck@efce5bec5854bf0560ae7ecb217436bbe766b817 call \
func (m *MyModule) Example() *dagger.Shellcheck  {
	return dag.
			Shellcheck()
}
@function
def example() -> dagger.Shellcheck:
	return (
		dag.shellcheck()
	)
@func()
example(): Shellcheck {
	return dag
		.shellcheck()
}

Types

Shellcheck 🔗

Shellcheck provides functions for checking shell scripts.

check() 🔗

Check runs shellcheck on all .sh and .bash files in the source directory. If an optional config file is provided, it is placed in the working directory as .shellcheckrc.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-

Source directory containing shell scripts.

severityString -

Minimum severity of errors to report (error, warning, info, style).

configFile -

Optional shellcheck configuration file (.shellcheckrc).

Example
dagger -m github.com/softwaredevelop/daggerverse/shellcheck@efce5bec5854bf0560ae7ecb217436bbe766b817 call \
 check --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Container  {
	return dag.
			Shellcheck().
			Check(source)
}
@function
def example(source: dagger.Directory) -> dagger.Container:
	return (
		dag.shellcheck()
		.check(source)
	)
@func()
example(source: Directory): Container {
	return dag
		.shellcheck()
		.check(source)
}

checkWithConfig() 🔗

CheckWithConfig runs shellcheck explicitly using the provided configuration file via –rcfile. The configuration file is mandatory for this function.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-

Source directory containing shell scripts.

fileFile !-

Mandatory configuration file for shellcheck.

severityString -

Minimum severity of errors to report (error, warning, info, style).

Example
dagger -m github.com/softwaredevelop/daggerverse/shellcheck@efce5bec5854bf0560ae7ecb217436bbe766b817 call \
 check-with-config --source DIR_PATH --file file:path
func (m *MyModule) Example(source *dagger.Directory, file *dagger.File) *dagger.Container  {
	return dag.
			Shellcheck().
			Checkwithconfig(source, file)
}
@function
def example(source: dagger.Directory, file: dagger.File) -> dagger.Container:
	return (
		dag.shellcheck()
		.checkwithconfig(source, file)
	)
@func()
example(source: Directory, file: File): Container {
	return dag
		.shellcheck()
		.checkWithConfig(source, file)
}