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@efce5bec5854bf0560ae7ecb217436bbe766b817Entrypoint
Return Type
Shellcheck !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | - | 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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing shell scripts. |
| severity | String | - | Minimum severity of errors to report (error, warning, info, style). |
| config | File | - | Optional shellcheck configuration file (.shellcheckrc). |
Example
dagger -m github.com/softwaredevelop/daggerverse/shellcheck@efce5bec5854bf0560ae7ecb217436bbe766b817 call \
check --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing shell scripts. |
| file | File ! | - | Mandatory configuration file for shellcheck. |
| severity | String | - | 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:pathfunc (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)
}