-
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
finer grained control over shell dialect features #1341
Comments
@yetamrra another use case that would be covered by this is defining dialects for projects. for example, linting Gentoo ebuild/eclass files follow a particular set of rules that we'd like to be able to enforce. |
SC2039 should really have had a separate error code per issue, that way you could just have ignored that particular one. |
Kangie
pushed a commit
to Kangie/shellcheck
that referenced
this issue
Feb 27, 2023
part of POSIX shell. See https://crbug.com/891826 for discussion and koalaman#1341 for an upstream proposal to fix this more completely. BUG=chromium:891826 TEST=None Change-Id: Ie46e296fd85d4d919c0076d9206cc804aa1b79e3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
today shellcheck has one big knob to control dialect: the
-s
option. we'd like to run shellcheck against scripts and say it's the POSIX dialect but with support forlocal
. our options today are not optimal:--shell=dash
, but then silently allow dashisms--shell=bash
, but then silently allow bashisms--shell=sh -e SC2039
, but then silently allow all undefined thingsit looks like dialect details are sprinkled through out the code base:
] ++ if not isDash then ["local"] else []
whenShell [Bash, Dash] $ do -- Ksh allows it, Sh doesn't support local
if the dialect details were split out into a data structure (a dict/map), and all the code checked that data structure, it'd be easy to expose those to the command line as people could set specific dialect features directly.
on the other hand, if we consider
local
a common enough thing, adding a one-off knob for it would be OK too :).The text was updated successfully, but these errors were encountered: