Skip to content

Commit

Permalink
feat: hadolint 2.8.0
Browse files Browse the repository at this point in the history
Hadolint 2.8 introduces the `sarif` format, useful for standardized
security reporting.
  • Loading branch information
jbergstroem committed Nov 5, 2021
1 parent feedc6b commit d8223d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion HADOLINT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.8.0
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ More usage examples [can be found in USAGE.md](USAGE.md).
## Parameters
| Variable | Default | Description |
| :------------ | :------------- | :----------------------------------------------------------------------------------------------------------------- |
| dockerfile | `./Dockerfile` | Path to Dockerfile(s). Accepts shell expansions (`**/Dockerfile`) |
| config_file | | Path to optional config (hadolint defaults to read `./hadolint.yml` if it exists) |
| error_level | `0` | Fail CI based on hadolint output (`-1`: never, `0`: error, `1`: warning, `2`: info) |
| annotate | true | Annotate code inline in the github PR viewer (`true`/`false`) |
| output_format | | Set output format (choose between `tty`, `json`, `checkstyle`, `codeclimate`, `gitlab_codeclimate` or `sonarqube`) |
| hadolint_path | | Absolute path to hadolint binary. If unset, it is assumed to exist in `$PATH` |
| Variable | Default | Description |
| :------------ | :------------- | :-------------------------------------------------------------------------------------------------------------------------- |
| dockerfile | `./Dockerfile` | Path to Dockerfile(s). Accepts shell expansions (`**/Dockerfile`) |
| config_file | | Path to optional config (hadolint defaults to read `./hadolint.yml` if it exists) |
| error_level | `0` | Fail CI based on hadolint output (`-1`: never, `0`: error, `1`: warning, `2`: info) |
| annotate | true | Annotate code inline in the github PR viewer (`true`/`false`) |
| output_format | | Set output format (choose between `tty`, `json`, `checkstyle`, `codeclimate`, `gitlab_codeclimate`, `sonarqube` or `sarif`) |
| hadolint_path | | Absolute path to hadolint binary. If unset, it is assumed to exist in `$PATH` |

## Hadolint version

Expand Down
2 changes: 1 addition & 1 deletion lib/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function validate_annotate() {
}

function validate_output_format() {
local -a output_formats=(tty json checkstyle codeclimate gitlab_codeclimate sonarqube)
local -a output_formats=(tty json checkstyle codeclimate gitlab_codeclimate sonarqube sarif)
for format in "${output_formats[@]}"; do
[[ "${format}" == "${1}" ]] && return 0
done
Expand Down
3 changes: 2 additions & 1 deletion test/unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ test_validate_invalid_annotate() {

test_validate_output_format() {
assert "validate_output_format gitlab_codeclimate"
assert "validate_output_format tty"
assert "validate_output_format sarif"
assert "validate_output_format sonarqube"
assert_fail "validate_output_format bbs"
}

test_validate_invalid_output_format() {
Expand Down

0 comments on commit d8223d4

Please sign in to comment.