Skip to content
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

Inline ignores in files #237

Open
jbergstroem opened this issue Oct 20, 2022 · 1 comment · May be fixed by #375
Open

Inline ignores in files #237

jbergstroem opened this issue Oct 20, 2022 · 1 comment · May be fixed by #375
Labels
enhancement New feature or request

Comments

@jbergstroem
Copy link
Contributor

I'd love to see inline/annotation support for ignore rules. Many other linters (one example: shellcheck) does the same.

The ignore rule would then only apply to the following line instead of all files in the run. Similarly, applying it to the top of the file would only apply it to said file.

Example (from actionlint annotation examples):

      - name: Run Actionlint
        # actionlint ignore=SC2016
        run: |
          actionlint -format '{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}}{{end}}' .github/workflows/*.yml
@cooljeanius
Copy link

cooljeanius commented Oct 25, 2023

Slightly related, but I also tried putting the ignore comment directly into the script, and it turns out that that doesn't work either, i.e.:

      - name: Build
        run: |
          # shellcheck disable=SC2001
          # (script goes here)

It would be nice if the existing format for shellcheck comments were supported in addition to any new formats.

Edit: actually never mind; I've found that the "# shellcheck disable" comments just need to go on the line directly before the warning they're disabling (rather than at the top), and then they work. Of course, finding the exact line would be easier if #360 were fixed...

@kounoike kounoike linked a pull request Nov 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants