Skip to content

Commit bef3dba

Browse files
rhodeonkyleconroy
authored andcommitted
Updated docs to reflect the support of rule names for the vet disable annotation.
1 parent 5b81b1c commit bef3dba

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/howto/vet.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,24 @@ rules:
259259
### Opting-out of lint rules
260260

261261
For any query, you can tell `sqlc vet` not to evaluate lint rules using the
262-
`@sqlc-vet-disable` query annotation.
262+
`@sqlc-vet-disable` query annotation. The annotation accepts a list of rules to ignore.
263+
264+
```sql
265+
/* name: GetAuthor :one */
266+
/* @sqlc-vet-disable sqlc/db-prepare no-pg */
267+
SELECT * FROM authors
268+
WHERE id = ? LIMIT 1;
269+
```
270+
The rules can also be split across lines.
271+
```sql
272+
/* name: GetAuthor :one */
273+
/* @sqlc-vet-disable sqlc/db-prepare */
274+
/* @sqlc-vet-disable no-pg */
275+
SELECT * FROM authors
276+
WHERE id = ? LIMIT 1;
277+
```
278+
279+
To skip all rules for a query, you can provide the `@sqlc-vet-disable` annotation without any options.
263280

264281
```sql
265282
/* name: GetAuthor :one */

0 commit comments

Comments
 (0)