Dagger
Search

shellcheck

The goals of ShellCheck are:

- To point out and clarify typical beginner's syntax issues that cause a shell to give cryptic error messages.
- To point out and clarify typical intermediate level semantic problems that cause a shell to behave strangely and counter-intuitively.
- To point out subtle caveats, corner cases and pitfalls that may cause an advanced user's otherwise working script to fail under future circumstances.

Installation

dagger install github.com/purpleclay/daggerverse/shellcheck@910e1ac9754f208569ac4d65f1ef52d9a2301833

Entrypoint

Return Type
Shellcheck !
Arguments
NameTypeDefault ValueDescription
baseContainer -a custom base image containing an installation of shellcheck
Example
dagger -m github.com/purpleclay/daggerverse/shellcheck@910e1ac9754f208569ac4d65f1ef52d9a2301833 call \
func (m *myModule) example() *Shellcheck  {
	return dag.
			Shellcheck()
}
@function
def example() -> dag.Shellcheck:
	return (
		dag.shellcheck()
	)
@func()
example(): Shellcheck {
	return dag
		.shellcheck()
}

Types

Shellcheck 🔗

ShellCheck dagger module

check() 🔗

Checks shell scripts for syntactic and semantic issues that may otherwise be difficult to identify

Return Type
String !
Arguments
NameTypeDefault ValueDescription
exclude[String ! ] -exclude checks with the following codes
formatString -the output format of the shellcheck report (checkstyle, diff, gcc, json, json1, quiet, tty)
include[String ! ] -only consider checks with the following codes
paths[String ! ] ["*.sh"]a list of paths for checking
severityString -the minimum severity of errors to consider when checking scripts (error, warning, info, style)
shellString -the type of shell dialect to check against (sh, bash, dash, ksh, busybox)
srcDirectory !-a path to a directory containing scripts to scan, this can be a project root
Example
dagger -m github.com/purpleclay/daggerverse/shellcheck@910e1ac9754f208569ac4d65f1ef52d9a2301833 call \
 check --src DIR_PATH
func (m *myModule) example(ctx context.Context, src *Directory) string  {
	return dag.
			Shellcheck().
			Check(ctxsrc)
}
@function
async def example(src: dagger.Directory) -> str:
	return await (
		dag.shellcheck()
		.check(src)
	)
@func()
async example(src: Directory): Promise<string> {
	return dag
		.shellcheck()
		.check(src)
}