Skip to content
Merged
Prev Previous commit
Next Next commit
Updated docs to reflect the support of rule names for the vet disable…
… annotation.
  • Loading branch information
rhodeon authored and kyleconroy committed Nov 25, 2024
commit bef3dbac8f8a1a1eb652b11afe2512d808b36dbd
19 changes: 18 additions & 1 deletion docs/howto/vet.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,24 @@ rules:
### Opting-out of lint rules

For any query, you can tell `sqlc vet` not to evaluate lint rules using the
`@sqlc-vet-disable` query annotation.
`@sqlc-vet-disable` query annotation. The annotation accepts a list of rules to ignore.

```sql
/* name: GetAuthor :one */
/* @sqlc-vet-disable sqlc/db-prepare no-pg */
SELECT * FROM authors
WHERE id = ? LIMIT 1;
```
The rules can also be split across lines.
```sql
/* name: GetAuthor :one */
/* @sqlc-vet-disable sqlc/db-prepare */
/* @sqlc-vet-disable no-pg */
SELECT * FROM authors
WHERE id = ? LIMIT 1;
```

To skip all rules for a query, you can provide the `@sqlc-vet-disable` annotation without any options.

```sql
/* name: GetAuthor :one */
Expand Down