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

Allow selective disabling of rules per query #3620

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rhodeon
Copy link

@rhodeon rhodeon commented Sep 29, 2024

This resolves #3619 and has some minor refactor in regards to reusable constants.

As mentioned there, the @sqlc-vet-disable query annotation now accepts a list of rules to skip:

/* @sqlc-vet-disable sqlc/db-prepare no-pg */

Providing just /* @sqlc-vet-disable */ without any parameters retains the previous behaviour of skipping all rules for a query.

@rhodeon rhodeon force-pushed the selectively-disable-rules-per-query branch from 90c4935 to 7a16c28 Compare September 29, 2024 03:02
@rhodeon
Copy link
Author

rhodeon commented Oct 17, 2024

@kyleconroy, can you please confirm if this is something worth having?
We have quite a few queries which benefit from it.

…ided rules.

This is an update to the original behaviour which had an "all-or-nothing" behaviour, either running all the rules on a query or skipping them all.
Specified rules which aren't declared in the sqlc config file get rejected.
…tFlags()` in order to be more generic as it now returns the rule skip list and could potentially return more data in the future.
@kyleconroy kyleconroy force-pushed the selectively-disable-rules-per-query branch from 09308a8 to 474ee13 Compare November 25, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow selective disabling of rules per query
1 participant