Commit Graph

8 Commits

Author SHA1 Message Date
Horacio Sanson 5458a1b291
Fix 3103 - add shellcheck shell directive detection. (#3216)
* Fix 3103 - add shellcheck shell directive detection.

Searches for shellcheck shell directive to detect dialects for scripts
that do not have shebang.

* Change order of detection of shellcheck dialect

In a situation where the filetype can be wrong (example: something.sh
which is written in bash dialect) and has no hash-bang (since it is
meant to be sourced) then the override specified within the script will
be ignored.

It probably is the most right thing to do if the script author has added
a specific directive; it should trump everything else.

Co-authored-by: Horacio Sanson <horacio@allm.inc>
Co-authored-by: Dino Korah <dino.korah@redmatter.com>
2020-11-21 20:49:31 +00:00
w0rp eb864730e2
Merge pull request #2906 from elebow/shelldetect-fall-back-to-filetype-if-no-hashbang
ShellDetect falls back to filetype if no hashbang (fixes #2886)
2020-08-17 21:29:16 +01:00
Ian2020 f67cb56e5e Fix shell detection test, shellcheck function name has changed 2020-04-28 18:20:10 +01:00
Eddie Lebow 1997a8f7e2
ShellDetect: fall back to filetype if no hashbang
Some files lack a hashbang line but still have an unambiguous filetype.
For example, the file `.zshrc` has the filetype `zsh`.

Augment ale#handlers#sh#GetShellType to fall back to the filetype if
no hashbang line can be found.
2019-11-23 00:34:40 -05:00
Andrew Imeson a6de3f3727
Add better detection for KornShell/ksh 2019-01-24 14:14:49 -05:00
Andrew Imeson eec8b9da60
Fix test name for csh to not say zsh 2019-01-24 13:30:50 -05:00
w0rp 33c2c20e66 Fix #1051 - Support ash and dash for shellcheck and the sh linter 2017-10-26 21:21:42 +01:00
w0rp b031531e79 #869 - Detect the shell dialect from the hashbang for shellcheck 2017-08-28 19:16:23 +01:00