Initial draft of plugin.
All checks were successful
All checks were successful
This commit is contained in:
parent
0a8cf88f53
commit
b8c4a9c224
16 changed files with 720 additions and 0 deletions
72
README.md
Normal file
72
README.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
# Shellcheck WoodpeckerCI Plugin
|
||||
|
||||
[](https://hub.docker.com/r/kokuwaio/shellcheck)
|
||||
[](https://hub.docker.com/r/kokuwaio/shellcheck)
|
||||
[](https://git.kokuwa.io/woodpecker/shellcheck/src/branch/main/Dockerfile)
|
||||
[](https://git.kokuwa.io/woodpecker/shellcheck/src/branch/main/LICENSE)
|
||||
[](https://git.kokuwa.io/woodpecker/shellcheck/pulls)
|
||||
[](https://git.kokuwa.io/woodpecker/shellcheck/issues)
|
||||
|
||||
A [WoodpeckerCI](https://woodpecker-ci.org) plugin for [shellsheck](https://github.com/koalaman/shellcheck) to lint shell files.
|
||||
Also usable with Gitlab, Github or locally, see examples for usage.
|
||||
|
||||
## Features
|
||||
|
||||
- preconfigure Shellcheck parameters
|
||||
- searches for shell files recursive
|
||||
- runnable with local docker daemon
|
||||
|
||||
## Example
|
||||
|
||||
Woodpecker:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
shellcheck:
|
||||
image: kokuwaio/shellcheck
|
||||
settings:
|
||||
shell: bash
|
||||
severity: error
|
||||
when:
|
||||
event: pull_request
|
||||
path: "**/*.sh"
|
||||
```
|
||||
|
||||
Gitlab:
|
||||
|
||||
```yaml
|
||||
shellcheck:
|
||||
stage: lint
|
||||
image: kokuwaio/shellcheck
|
||||
variables:
|
||||
PLUGIN_SHELL: bash
|
||||
PLUGIN_SEVERITY: error
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
changes: ["**/*.sh"]
|
||||
```
|
||||
|
||||
CLI:
|
||||
|
||||
```bash
|
||||
docker run --rm --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/shellcheck --shell=bash --severity=error
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
| Settings Name | Environment | Default | Description |
|
||||
| -------------- | --------------- | -------- | -------------------------------------------------------------- |
|
||||
| `shell` | PLUGIN_SHELL | `none` | Specify dialect (sh, bash, dash, ksh, busybox) |
|
||||
| `severity` | PLUGIN_SEVERITY | `style` | Minimum [severity](https://github.com/koalaman/shellcheck/wiki/severity) of errors to consider (error, warning, info, style) |
|
||||
| `include` | PLUGIN_INCLUDE | `none` | Consider only given types of warnings |
|
||||
| `exclude` | PLUGIN_EXCLUDE | `none` | Exclude types of warnings |
|
||||
| `color` | PLUGIN_COLOR | `always` | Use color (auto, always, never) |
|
||||
| `format` | PLUGIN_FORMAT | `tty` | Output format (checkstyle, diff, gcc, json, json1, quiet, tty) |
|
||||
|
||||
## Alternatives
|
||||
|
||||
| Image | Comment | amd64 | arm64 |
|
||||
| --------------------------------------------------------------------------------------- | --------------------------------- |:-----:|:-----:|
|
||||
| [kokuwaio/shellcheck](https://hub.docker.com/r/kokuwaio/shellcheck) | Woodpecker plugin | [](https://hub.docker.com/r/kokuwaio/shellcheck) | [](https://hub.docker.com/r/kokuwaio/shellcheck) |
|
||||
| [koalaman/shellcheck](https://hub.docker.com/r/koalaman/shellcheck) | not a Woodpecker plugin, official | [](https://hub.docker.com/r/koalaman/shellcheck) | [](https://hub.docker.com/r/koalaman/shellcheck) |
|
||||
| [pipelinecomponents/shellcheck](https://hub.docker.com/r/pipelinecomponents/shellcheck) | not a Woodpecker plugin | [](https://hub.docker.com/r/pipelinecomponents/shellcheck) | [](https://hub.docker.com/r/pipelinecomponents/shellcheck) |
|
Loading…
Add table
Add a link
Reference in a new issue