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@v0.1.0

Entrypoint

Return Type
Shellcheck !
Arguments
NameTypeDescription
baseContainer a custom base image containing an installation of shellcheck
Example
dagger -m github.com/purpleclay/daggerverse/shellcheck@84ea03f63438eacf4e3296cdcef05d24c2c03218 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
formatString -the output format of the shellcheck report (checkstyle, diff, gcc, json, json1, quiet, tty)
paths[String ! ] !-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@84ea03f63438eacf4e3296cdcef05d24c2c03218 call \
 check --paths string1 --paths string2 --src DIR_PATH
func (m *myModule) example(ctx context.Context, paths []string, src *Directory) string  {
	return dag.
			Shellcheck().
			Check(ctxpaths, src)
}
@function
async def example(paths: List[str], src: dagger.Directory) -> str:
	return await (
		dag.shellcheck()
		.check(paths, src)
	)
@func()
async example(paths: string[], src: Directory): Promise<string> {
	return dag
		.shellcheck()
		.check(paths, src)
}