mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
adding a workflow to check files not ending in .sh
13
GitLab-CI.md
13
GitLab-CI.md
@@ -21,4 +21,17 @@ test:
|
||||
- git ls-files --exclude='*.sh' --ignored -c -z | xargs -0r shellcheck
|
||||
```
|
||||
|
||||
If you want to lint *all* shell scripts (i.e. with a shebang), even those not ending on `.sh`:
|
||||
|
||||
```yaml
|
||||
test:
|
||||
image: koalaman/shellcheck-alpine:latest
|
||||
stage: test
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add git
|
||||
script:
|
||||
- git ls-files -c -z | xargs -0 awk -vORS='\0' 'FNR==1 && /^#!.*sh/ { print FILENAME }') | xargs -0r shellcheck
|
||||
```
|
||||
|
||||
If you want to create a JUnit XML report to see in the GitLab's UI, check the instructions [here](JUnit), additionally checkstyle can also be [transformed](checkstyle2text) back into text again for logging purposes.
|
Reference in New Issue
Block a user