feat(vet): Introduce a query annotation to opt out of sqlc vet rules #2474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing the
@sqlc-vet-disable
query annotation, to opt individual queries out of sqlc vet rules, based on #2454.I'm not sure that printing a message to stdout when skipping a query is ideal, but I didn't want to skip silently or return an error and I couldn't use stderr obviously. If skipping silently is better for now I'm happy to remove that line.
Related to the above, I couldn't figure an easy way to test this new functionality without passing in an output stream separate from stderr where a test would expect the skip message to appear. I can do that, but I wasn't sure about the approach and I'm not a testing expert so maybe there's a better thing we could do. Anyway please advise if there's something I should add regarding testing.