mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 21:24:33 +08:00
Merge pull request #2906 from elebow/shelldetect-fall-back-to-filetype-if-no-hashbang
ShellDetect falls back to filetype if no hashbang (fixes #2886)
This commit is contained in:
@@ -98,6 +98,16 @@ Execute(The ksh dialect should be used for shellcheck if b:is_kornshell is 1):
|
||||
|
||||
AssertEqual 'ksh', ale#handlers#shellcheck#GetDialectArgument(bufnr(''))
|
||||
|
||||
Execute(The filetype should be used as the default shell type when there is no hashbang line):
|
||||
set filetype=zsh
|
||||
AssertEqual 'zsh', ale#handlers#sh#GetShellType(bufnr(''))
|
||||
|
||||
set filetype=tcsh
|
||||
AssertEqual 'tcsh', ale#handlers#sh#GetShellType(bufnr(''))
|
||||
|
||||
set filetype=python
|
||||
AssertEqual '', ale#handlers#sh#GetShellType(bufnr(''))
|
||||
|
||||
Given(A file with /bin/ash):
|
||||
#!/bin/ash
|
||||
|
||||
|
||||
Reference in New Issue
Block a user