An open API service indexing awesome lists of open source software.

https://github.com/assertwell/shellcheck

Expose ShellCheck as a vendor binary for PHP projects
https://github.com/assertwell/shellcheck

composer-package shellcheck

Last synced: 4 months ago
JSON representation

Expose ShellCheck as a vendor binary for PHP projects

Awesome Lists containing this project

README

          

# ShellCheck

[Vidar Holen's ShellCheck is an invaluable tool for troubleshooting shell scripts](https://www.shellcheck.net), and this package makes it easy to import into the testing pipeline of your PHP-based project!

## How it works

This package contains a `bin/shellcheck` script that serves as a proxy to the system-installed copy of ShellCheck; if the ShellCheck binary is found, arguments pass through to it normally. If ShellCheck is **not** found locally, users are presented with the following notice:

> ShellCheck was not found in your $PATH!
> Please visit https://github.com/koalaman/shellcheck#installing for installation instructions.

Normally, this would result in a non-zero exit code (2), though this behavior may be suppressed with the `--ignore-missing` option:

```none
$ vendor/bin/shellcheck --ignore-missing some-script.sh

ShellCheck was not found in your $PATH!
Please visit https://github.com/koalaman/shellcheck#installing for installation instructions.

$ echo $?
0
```

## Installation

The easiest way to install this package is via [Composer](https://getcomposer.org):

```sh
$ composer require --dev assertwell/shellcheck
```

You may wish to add a [Composer script](https://getcomposer.org/doc/articles/scripts.md) to make it easier for team members to run ShellCheck:

```jsonc
# composer.json
{
// ...
"scripts": {
"test:shellcheck": [
"shellcheck bin/*"
]
},
"scripts-descriptions": [
"test:shellcheck": "Lint shell scripts via ShellCheck"
]
}
```

As for the installation of ShellCheck itself, please [see the instructions most-relevant to your environment in the ShellCheck documentation](https://github.com/koalaman/shellcheck#installing).

## License

[The assertwell/shellcheck Composer package is available under the MIT license](LICENSE.md).

ShellCheck itself is the copyright of Vidar Holden and made [available under the GPLv3 license](https://github.com/koalaman/shellcheck/blob/master/LICENSE).