Description
I didn't find documentation in Stitch regarding inline suppression of specific problems, so I would like to suggest adding this functionality.
In a GameMaker project, I have functions that initialize dynamically but appear unused due to being called by gml_pragma
rather than through a direct invocation. Stitch currently flags these as unused functions.
I'm proposing the ability to suppress specific Stitch warnings inline using comments, allowing developers to ignore particular warnings for specific lines or code blocks they've already reviewed.
Proposed Syntax:
-
Suppressing a Warning for the Next Line:
// @stitch-ignore-next-line: unused-function offending_code();
-
Suppressing a Warning Inline:
offending_code(); // @stitch-ignore: unused-function
-
Suppressing Multiple Warnings Inline:
offending_code(); // @stitch-ignore: unused-function, deprecated-function
This feature would allow developers to maintain focused, intentional code analysis, which is especially useful in legacy projects where modernizing code could generate many non-critical warnings. It would help avoid the temptation to ignore warnings altogether by supporting case-by-case suppression, aligning Stitch with practices in other code analysis tools, such as eslint
for JavaScript (offending() // eslint-ignore
) or Flake8
for Python (offending() # noqa: E731
).
If you made it this far, thank you for considering this enhancement request!