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@910e1ac9754f208569ac4d65f1ef52d9a2301833Entrypoint
Return Type
Shellcheck !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| base | Container | - | a custom base image containing an installation of shellcheck |
Example
dagger -m github.com/purpleclay/daggerverse/shellcheck@910e1ac9754f208569ac4d65f1ef52d9a2301833 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 dagger module
check() 🔗
Checks shell scripts for syntactic and semantic issues that may otherwise be difficult to identify
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| exclude | [String ! ] | - | exclude checks with the following codes |
| format | String | - | 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 |
| severity | String | - | the minimum severity of errors to consider when checking scripts (error, warning, info, style) |
| shell | String | - | the type of shell dialect to check against (sh, bash, dash, ksh, busybox) |
| src | Directory ! | - | 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_PATHfunc (m *MyModule) Example(ctx context.Context, src *dagger.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)
}