mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Remove the other options since its installed by default.
119
TravisCI.md
119
TravisCI.md
@@ -11,122 +11,3 @@ script:
|
||||
Note:
|
||||
>Travis CI has now integrated ShellCheck by default, so you don't need to manually install it.
|
||||
|
||||
Thus the older suggestions below are no longer necessary.
|
||||
|
||||
----
|
||||
contributor hugovk says:
|
||||
|
||||
>It took me a while to find a way to install on Travis CI, but thanks to this I got it working:
|
||||
|
||||
```yaml
|
||||
language: bash
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- debian-sid # Grab shellcheck from the Debian repo (o_O)
|
||||
packages:
|
||||
- shellcheck
|
||||
|
||||
script:
|
||||
- bash -c 'shopt -s globstar; shellcheck **/*.{sh,bash}'
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
```
|
||||
|
||||
**NOTE:** This solution may break if you install other packages from APT as well, refer [Errors were encountered while processing: /var/cache/apt/archives/locales_2.19-20_all.deb · Issue #4838 · travis-ci/travis-ci](https://github.com/travis-ci/travis-ci/issues/4838)
|
||||
|
||||
***
|
||||
|
||||
|
||||
contributor ccztux says:
|
||||
|
||||
>This is how you can implement shellcheck on Travis CI using the latest docker image:
|
||||
|
||||
```yaml
|
||||
sudo: required
|
||||
|
||||
language: bash
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- docker pull koalaman/shellcheck
|
||||
|
||||
script:
|
||||
- docker run -v $(pwd):/scripts koalaman/shellcheck /scripts/yourscript.sh
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
contributor @Lin-Buo-Ren says:
|
||||
|
||||
> Here's a Git submodule and Travis CI configuration that support build and install latest release of ShellCheck without root access using Cabal
|
||||
> http://github.com/Lin-Buo-Ren/Utilities-for-Travis-CI
|
||||
> Also a cache is preserved to decrease subsequent build time
|
||||
|
||||
```yaml
|
||||
---
|
||||
language: bash
|
||||
sudo: false
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- realpath # required by script
|
||||
- cabal-install
|
||||
- ghc
|
||||
|
||||
install:
|
||||
- ./"Build and Setup ShellCheck's Latest Release.bash" --without-root
|
||||
- PATH="${HOME}/.cabal/bin:${PATH}"
|
||||
|
||||
before_cache:
|
||||
- rm $HOME/.cabal/logs/build.log
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cabal
|
||||
```
|
||||
|
||||
> Here's another Git submodule to check all Bash scripts in the repository excluding its submodules using ShellCheck:
|
||||
> https://github.com/Lin-Buo-Ren/GNU-Bash-Automatic-Checking-Program-for-Git-Projects
|
||||
|
||||
***
|
||||
|
||||
contributor ntrrg says:
|
||||
|
||||
> Using the binary (Linux x64) is pretty straightforward
|
||||
|
||||
```yaml
|
||||
language: bash
|
||||
before_install:
|
||||
- wget -c https://goo.gl/ZzKHFv -O - | tar -xvJ -C /tmp/
|
||||
- PATH="/tmp/shellcheck-latest:$PATH"
|
||||
script: shellcheck */**/*.sh
|
||||
```
|
||||
|
||||
> Makefiles can easily integrate it
|
||||
|
||||
`Makefile`:
|
||||
|
||||
```Makefile
|
||||
.PHONY: lint
|
||||
lint: /tmp/shellcheck-latest/shellcheck
|
||||
$< */**/*.sh
|
||||
|
||||
/tmp/shellcheck-latest/shellcheck:
|
||||
wget -c 'https://goo.gl/ZzKHFv' -O - | tar -xvJ -C /tmp/
|
||||
```
|
||||
|
||||
`.travis.yml`:
|
||||
|
||||
```yaml
|
||||
language: bash
|
||||
script: make lint
|
||||
```
|
||||
|
Reference in New Issue
Block a user