-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also parse the color
option from the config file
#2350
Comments
Signed-off-by: Olliver Schinagl <[email protected]>
I suggest that the example for |
As mentioned on the PR, you can have multiple |
Ideally "nearest wins", so whichever first mentions it among a list something like this:
In a functional language I'm guessing that it's easier to go "use the current value if any, or look for the next one; but in a procedural language it might be easier to implement by reversing this list and having "last wins" simply by implicitly overwriting earlier values. I wonder whether things like |
For the most part, this is how it already works for individual script files. Is the suggestion to look for the nearest |
No, I don't think prioritizing the current directory would be as useful as relative to the file to be inspected. My main intent is if there's precedence between the files, then it's not ambiguous, just pick a winner. |
Signed-off-by: Olliver Schinagl <[email protected]>
I agree, lets have the discussion here, and keep the MR technical. To sort of repeat what I wrote there as well; I think that shellcheck should favor the local file for specific options, and for more 'global in kind' option whatever is in the root. I think generally for the per repo config files, its all relatively easy to figure out. How those play with local config options, that's harder. E.g. if I have in my shellcheckrc in my homedir 'color=always |
I can envisage having Shellcheck as a pre-commit check in a repo, and in that case the project should control which things are treated as errors. For this purpose it's important that the output be parsable, so I would want the per-repo or per-directory options to take precedence, for all options (not just color=xxxx). Whilst I can see how how having $HOME/.whatever take precedence for cosmetic adjustments seems useful, I think there will be conflicting opinions on where the line should be drawn between "cosmetic" and "API impacting". I think most would agree that the difference between Having different precedence order for different configuration options would be insanely complex, both for coding, and for human understanding. I would rather a consistent precedence with a simple logic: the further away a config file is from the file being inspected, the lower its precedence. That said, I don't think having |
I guess one possible approach is to get "global" options from the
This is indeed the exact rationale for the current behavior. |
Shellcheck seems to ignore the
color=
option if it is placed in the .shellcheckrc file. IMO any commandline argument should be also parseable from the config file (the user can still override this after all).This feature request is to support honoring the
color=
directive from the config file.The text was updated successfully, but these errors were encountered: