Bug 452400

Summary: Kate can not use the -x switch of Shellcheck
Product: [Applications] kate Reporter: Ganton <kubry>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 21.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Ganton 2022-04-08 12:58:27 UTC
Dear Kate developers,

Currently, there is no way in Kate to use the -x switch of Shellcheck. That switch is needed in a lot of cases. 

VS Code has a way, which is [described after a description about problems people have if they can not use -x](https://unix.stackexchange.com/questions/534688/vs-code-editor-how-to-include-x-switch-for-shellcheck).
Comment 1 Ganton 2022-04-08 12:59:15 UTC
For example: a form could be added to choose Shellcheck arguments, or in the "shellcheck.cpp" file (https://invent.kde.org/utilities/kate/-/blob/master/addons/project/tools/shellcheck.cpp can be seen) the line
    _args << QStringLiteral("--format=gcc");
could be replaced by
    _args << QStringLiteral("-x") << QStringLiteral("--format=gcc");
and enjoy the "-x" features. Other ways can be thought about.

And thanks for Kate!
Comment 2 Christoph Cullmann 2022-04-09 15:49:27 UTC
Hmm, the docs of shellcheck tell me you can just enable that in the default shellcheck config file globally:

This option may also be enabled using external-sources=true in .shellcheckrc.  This flag takes precedence.
Comment 3 Christoph Cullmann 2022-05-05 18:17:09 UTC
Hi, I think it would make more sense if you just alter the default in .shellcheckrc