Add Support for Suppressing Warnings/Errors per Line in Config Validation
j
jdalittle@gmail.com
I'm using the VS Code extension, but I presume it's the language server (?) that would be responsible for this. I want to be able to add some kind of ignore next line/current line to suppress warnings and (possibly) errors, so it doesn't continue to report problems that I've address/am intentionally leaving.
j
jdalittle@gmail.com
Still sad this is not a thing. Very annoying to have tens of "error" lines in my file when it's not really an error.
Would also accept simple option to disable config validation while still using other features.
P
Parker Rowe
jdalittle@gmail.com Hey! We are taking a look at this now and exploring possible solutions.
Having the option to simply disable the language server's diagnostics via the VSCode extension is one option that is useful as a nuclear option to get rid of erroneous errors.
In terms of granular control over per-line diagnostics, I like the suggestion you had. It's quite similar to how TypeScript and ESLint allow for exceptions to their language server errors through ignore comments. The practice is well known and familiar for many developers.
e.g.
```yaml
cci-ignore-file # Suppress all diagnostics for entire file
jobs:
my-job: # cci-ignore (suppress on current line)
cci-ignore-next-line # Suppress on next line only
executor: unknown-executor
cci-ignore-start # Begin suppression block
parallelism: 1
unused_key: value
another_issue: here
cci-ignore-end # End suppression block
```
This solution would also mean that we can suggest these comments as code actions via the Language Server Protocol. That way when users try to view fixes for the errors, their editor (VSCode or any other editor that supports it like Neovim) would suggest inserting one of these comments as a valid "fix".
Would this approach suit your needs for ignoring erroneous errors? Open to suggestions and feedback on this idea!
j
jdalittle@gmail.com
Parker Rowe, spot on. That'd be great.
Autopilot
Merged in a post:
Disable or Customize Language Server Validations in VS Code
j
jdalittle@gmail.com
Not infrequently, I get incorrect errors from the language server, or warnings I don't care about. It is distracting and annoying that there's no way to disable these as with most linters.
The easy button/option for me would be to at least allow disabling validations/not showing warnings/errors when viewing the file. I'd still like to keep autocomplete and other related features, but just let me opt out of the validations.
Even better would be "ignore next line" suppression and/or "ignore in file".
Even better would be to ignore classes/rules. Like, the context validation for me is totally wrong--it says contexts don't exist that do. And I really don't care to have that validated anyways.