Commit Graph

31 Commits

Author SHA1 Message Date
Vidar Holen 7963eeab9d Include shebang in AST traversal (fixes #1858) 2020-03-16 21:36:41 -07:00
Joseph C. Sible 42abcb7ae2 Simplify shellFromFilename 2020-02-09 23:18:09 -05:00
Joseph C. Sible c29b6afa56 Use null instead of comparing with empty lists 2020-02-01 23:04:04 -05:00
Joseph C. Sible 5487b3f229 Use sortOn instead of sortBy and comparing 2020-02-01 22:50:18 -05:00
Joseph C. Sible 28978a8b65 Use maybe instead of fromMaybe and fmap 2020-02-01 22:50:17 -05:00
Virgil ea05271fa3 📝 Update Copyright to year 2019 and Markdown linting
- [x] 📝 Update Copyright to year 2019

- [x] 📝 MD009/no-trailing-spaces: Trailing spaces [Expected: 0 or 2; Actual: 1]
- [x] 📝 MD034/no-bare-urls: Bare URL used

- [ ] 📝 ~MD004/ul-style: Unordered list style [Expected: dash; Actual: asterisk]~
- [ ] ~add missing TOC entries~
2019-05-14 20:12:34 +10:00
Vidar Holen 5fb1da6814 Replace verbose checks with optional checks 2019-05-12 19:14:04 -07:00
Vidar Holen d9e419d60f Add support for source-path directives (fixes #1577) 2019-05-09 19:54:41 -07:00
Vidar Holen c6c12f52bd Expand root paths into source paths 2019-04-24 18:51:24 -07:00
Vidar Holen c53c8a5ead Allow using 'source -- file' (fixes #1518) 2019-03-17 19:37:35 -07:00
Vidar Holen 581bcc3907 Add support for `.shellcheckrc` files 2019-03-03 18:57:13 -08:00
Vidar Holen 2737496b3a Fix grammatical error in comments 2019-01-22 19:47:40 -08:00
Gandalf- 59c47f2266 Issue 837 flag to include only certain warnings
Issue https://github.com/koalaman/shellcheck/issues/837

Add an --include option, which creates a whitelist of warnings to report
on, the opposite of --exclude.
2019-01-20 16:42:27 -08:00
Vidar Holen e1fe9be7af Fix minor details in new Bats support 2019-01-20 14:02:42 -08:00
Vidar Holen a504ca6b57 Add some unit tests for extension detection 2019-01-20 13:24:31 -08:00
Tito Sacchi 9f45dc4c8b Not determine the shell from `.sh` extension
See discussion on issue #1369 for details.
2019-01-18 09:21:07 +01:00
Tito Sacchi a4b9cec9f0 Fix #1369 (Use file extension to detect shell)
The precedence order that is used to determine the shell
is the following:
1. ShellCheck directive
2. Shebang
3. File extension
A new field `asFallbackShell` has been
added to the record type `AnalysisSpec`.
2019-01-14 14:32:25 +01:00
Vidar Holen 138080bdc7 Fix infinite loop on annotations for SC2188 (fixes #1413) 2018-12-16 14:42:19 -08:00
Ng Zhi An 4a87d2a3de Expose token positions in params, use that to construct fixes 2018-12-09 15:01:08 -08:00
Ng Zhi An 41613babd9 Prototype fix 2018-12-09 15:01:08 -08:00
Vidar Holen 932e2b3538 Merge branch 'opqaque-interface' of https://github.com/ngzhian/shellcheck into ngzhian-opqaque-interface 2018-08-18 20:32:27 -07:00
Martin Schwenke 3fe11927bb SQUASH: --severity specifies *minimum* severity to be handled
Signed-off-by: Martin Schwenke <martin@meltin.net>
2018-08-18 20:05:56 -07:00
Martin Schwenke b16da4b242 Add command-line option -S/--severity
Specifies the maximum severity of errors to handle.  For example,
specifying "-S warning" means that errors of severity "info" and
"style" are ignored.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2018-08-18 20:05:56 -07:00
Ng Zhi An c8e0797350 Make data in Interface more opaque 2018-08-17 22:10:18 -07:00
Vidar Holen 5005dc0fa1 Allow directive/-s to override shebang blacklist (fixes #974) 2018-07-22 12:43:51 -07:00
Ng Zhi An b63483d44c Remove unused import 2018-06-12 22:50:02 -07:00
Ng Zhi An 4111ce8fde Make end pos non-optional 2018-06-12 22:39:06 -07:00
Ng Zhi An 48ac654a93 Merge end pos map into start pos map 2018-06-07 21:55:41 -07:00
Russell Harmon 4470fe715c Support emitting a correct end column on SC2086
This does the necessary work to emit end columns on AST analyses. SC2086
is made to emit a correct end column as an illustrative example.

For example:
```
$ shellcheck -s bash -f json /dev/stdin <<< 'echo $1'
[{"file":"/dev/stdin","line":1,"endLine":1,"column":6,"endColumn":8,"level":"info","code":2086,"message":"Double quote to prevent globbing and word splitting."}]
```

This change deprecates the parser's getNextId and getNextIdAt, replacing
it with a new withNextId function. This function has the type signature:

withNextId :: Monad m => ParsecT s UserState (SCBase m) (Id -> b) -> ParsecT s UserState (SCBase m) b

Specifically, it should be used to wrap read* functions and will pass in
a newly generated Id which should be used to represent that node.
Sub-parsers will need their own call to withNextId in order to get a
unique Id.

In doing this, withNextId can now track both the entry and exit position
of every read* parser which uses it, enabling the tracking of end
columns throughout the application.
2018-06-07 21:55:41 -07:00
Vidar Holen 467dfe07b6 Add a unit test and separate ids for 884eff0c 2018-05-23 19:51:36 -07:00
Oleg Grenrus cd7c077ecc Move library into src/ 2018-03-08 19:57:40 +02:00