Add g:ale_sh_shellcheck_change_directory #2446
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a new
g:ale_sh_shellcheck_change_directory
option to control whether or not to change directory to where the source is located before runningshellcheck
. It defaults to1
, identical to the other linter directory-related options (I took heavy direction from the Python linters here) and so preserves the current behavior of ALE.This is to help ShellCheck users that have a larger source base with sub-directories and CI that prefers to run from the root of a repository. As ShellCheck determines the relative directory in the
shellcheck source=path/to/src.sh
to be relative to the current working directory, it's hard to to have a value that satisfies both a *vim/ALE and a Makefile/TravisCI setup. The option here can be used as a first step to harmonize these two cases while any future features/changes in ShellCheck develop (see koalaman/shellcheck#769 and koalaman/shellcheck#539 for more context).Thanks so much for your hard work on ALE. I know I'm not alone, and I know maintainers don't hear this nearly often enough, but tools like this really make a huge difference in daily developer life. ALE has made a massive difference for me and how I work, so thank you! 🍺