shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

Please update Shellcheck with a new output format to be used with modern AI IDE and Editors or CLI AI tools

Open Emasoft opened this issue 10 months ago • 0 comments

PROBLEM: Currently Shellcheck cannot be used with modern AI IDE and Editors or CLI AI tools. The reason is that the text format of the output returns only 1 line of code, the one with the error or problem. Instead AI models need more context to understand and produce a fixed version of that line. For more context I mean at least 10 lines of code before, and 10 lines of code after the reported line number. Only looking at the line of code in its context the AI can identify it and fix it. With the current Shellcheck the text format output is limited to quote one line of code, and this cause all the AI to fail to fix even the simplest of bugs. Even closing a missing parenthesis become impossible. Since the linter is called after every change to the code by the AI, and since the AI cannot fix the errors reported by the linter, any tool or ide using the AI with shellcheck will either enter an infinite loop, or will end creating duplicated code (that will be even more difficult to fix).

SOLUTION: Add to Shellcheck a new output format, similar to text, but with the line put in context, with the display of 10 lines of code before and 10 lines of code after the line with the error.

THANK YOU! 🙏

Emasoft avatar Feb 12 '25 15:02 Emasoft