Commit Graph

31 Commits

Author SHA1 Message Date
Pepe Iborra 4e7e3f9456
Add Haddock markup to SystemInterface 2020-12-22 09:15:57 +00:00
Vidar Holen a75219e525 Remove unused instance Ord Replacement (fixes #1829) 2020-02-17 12:44:38 -08:00
Joseph C. Sible 85c49a8af9 Simplify mockedSystemInterface 2020-02-09 23:50:48 -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
Pontus Andersson af46758ff1 Add option to look for sources in alternate root paths
Add a new optional flag "-r|--root ROOTPATHS", where ROOTPATHS is a
colon separated list of paths, that will look for external sources in
alternate roots.

This is particular useful when the run-time environment does not fully
match the development environment. The #shellcheck source=file directive
is useful, but has its limitations in certain scenarios. Also, in many
cases the directive could be removed from scripts when the root flag is
used.

Script example.bash:
  #!/bin/bash
  source /etc/foo/config

Example usage where etc/foo/config exists in skel/foo:
  # shellcheck -x -r skel/foo:skel/core example.bash
2019-04-22 17:54:42 +02:00
Vidar Holen 9652ccfdbd Add a verbose mode: `-S verbose` 2019-04-13 13:16:41 -07:00
Vidar Holen 581bcc3907 Add support for `.shellcheckrc` files 2019-03-03 18:57:13 -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
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 434b904746 Process replacements according to AST depth (fixes #1431) 2019-01-08 18:25:37 -08:00
Vidar Holen 897f019353 Move Ranged definition to Fixer to avoid overpromising 2018-12-22 10:04:00 -08:00
Ng Zhi An 0636e7023c Fix applying multiple fixes per line
Fixes #1421
2018-12-21 14:34:03 +08:00
Ng Zhi An 3471ad45b1 Smarter sorting and application of fix to handle multiple replacements 2018-12-17 00:20:50 -08:00
Vidar Holen bcd13614eb Improve Fix memory usage 2018-12-09 15:01:08 -08:00
Vidar Holen a8376a09a9 Minor renaming and output fixes 2018-12-09 15:01:08 -08:00
Ng Zhi An 5ed89d2241 Change definition of Replacement, add ToJSON instance for it 2018-12-09 15:01:08 -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 e0e46e979a Add wiki links to output, and a -W controlling it. (Fixes #920) 2018-10-10 21:53:43 -07: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 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
Oleg Grenrus cd7c077ecc Move library into src/ 2018-03-08 19:57:40 +02:00