Skip to content

Enhancement Request: Support for Inline Warning Suppression with @stitch-ignore #259

Open
@jhillacre

Description

@jhillacre

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:

  1. Suppressing a Warning for the Next Line:

    // @stitch-ignore-next-line: unused-function
    offending_code();
  2. Suppressing a Warning Inline:

    offending_code(); // @stitch-ignore: unused-function
  3. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions