Linter wrapper for globally installed linters.
Badge | Description | Service |
---|---|---|
Code style | Prettier | |
Commit style | Conventional Commits | |
Code coverage | Codecov | |
CI status: Build and test | Shippable | |
CI status: Commit style | Travis CI | |
npm package version | npm |
Run the CLI without any arguments to see the options. The options are also described in the table and paragraphs below.
Argument | Usage | Type | Reference |
---|---|---|---|
linter |
Required | String [hadolint , shellcheck ] |
details |
glob |
Required | String | details |
--ignore-path , -i |
Optional | String | details |
--range , -r |
Optional | String | details |
--options |
Optional | String | details |
—version , -v |
Optional | Boolean | details |
—help , -h |
Optional | Boolean |
Linter to run. Currently the list below shows the supported linter. If your favourite linter is not supported, please create a ticket to discuss adding support for it.
-
hadolint - Dockerfile Linter
A smarter Dockerfile linter that helps you build best practice Docker images. The linter is parsing the Dockerfile into an AST and performs rules on top of the AST. It is standing on the shoulders of ShellCheck to lint the Bash code inside
RUN
instructions. -
shellcheck - A shell script static analysis tool
The goals of ShellCheck are
- To point out and clarify typical beginner's syntax issues that cause a shell to give cryptic error messages.
- To point out and clarify typical intermediate level semantic problems that cause a shell to behave strangely and counter-intuitively.
- To point out subtle caveats, corner cases and pitfalls that may cause an advanced user's otherwise working script to fail under future circumstances.
Glob pattern for searching files. The glob syntax of the glob module is used, so the given pattern must be according to the syntax of node-glob.
Path to a file containing patterns that describe files to ignore. By default it looks for ./.prettierignore
. The patterns in the ignore file should be according to the .gitignore specification.
Version range the linter must satisfy. The range must be specified according to the node-semver ranges specification and will show an error otherwise. This option only works if the linter supports a version option, which for some linters is not included in early versions. The table below shows for which versions of each supported linter the range option is supported.
Linter | Range option supported from version | Reference |
---|---|---|
hadolint | >=1.2.0 |
v1.2 release notes. |
shellcheck | >=0.3.1 |
Commit 4e5d32b. |
Options to pass to the linter. When using string arguments that include dashes (-
), those will be seen as a separate option by the shell instead of part of the string. The problem is that shells like bash tend to strip quotes. The solution for this is to wrap the string in two sets of quotes of which there are two options.
-
Use double quotes inside single quotes.
--options '"--hello -x=yes -v"'
-
Use escaped double quotes inside double quotes.
--options "\"--hello -x=yes -v\""
Display only the version number and exit the process.
These docs will be added in the first (full) release 1.0.0.
This project is licensed under the GPLv3 license.
Copyright © 2019 Jeroen de Bruijn
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
The full text of the license is available in the LICENSE.md file in this repository and online.