33title : CLI
44---
55
6- ## usage
6+ ## Usage
77
88``` bash
99# lint a file or multiple
@@ -13,15 +13,31 @@ squawk migration_001.sql migration_002.sql migration_003.sql 'migrations/*.sql'
1313cat migration.sql | squawk
1414```
1515
16- ## rules
16+ ## Rules
1717
1818Individual rules can be disabled via the ` --exclude ` flag
1919
2020``` shell
2121squawk --exclude=adding-field-with-default,disallowed-unique-constraint example.sql
2222```
2323
24- ## files
24+ ### Disabling rules via comments
25+
26+ Rule violations can be ignored via the ` squawk-ignore ` comment:
27+
28+ ``` sql
29+ -- squawk-ignore ban-drop-column
30+ alter table t drop column c cascade;
31+ ```
32+
33+ You can also ignore multiple rules by making a comma seperated list:
34+
35+ ``` sql
36+ -- squawk-ignore ban-drop-column, renaming-column,ban-drop-database
37+ alter table t drop column c cascade;
38+ ```
39+
40+ ## Files
2541
2642Files can be excluded from linting via the ` --exclude-path ` flag. Glob matching is supported and the flag can be provided multiple times.
2743
@@ -41,9 +57,9 @@ squawk --config=~/.squawk.toml example.sql
4157
4258The ` --exclude ` , ` --exclude-path ` , and ` --pg-version ` flags will always be prioritized over the configuration file.
4359
44- ## example ` .squawk.toml ` configurations
60+ ## Example ` .squawk.toml ` configurations
4561
46- ### excluding rules
62+ ### Excluding rules
4763
4864``` toml
4965# .squawk.toml
@@ -53,21 +69,21 @@ excluded_rules = [
5369]
5470```
5571
56- ### specifying postgres version
72+ ### Specifying postgres version
5773
5874``` toml
5975# .squawk.toml
6076pg_version = " 11.0"
6177```
6278
63- ### specifying whether SQL files will be wrapped in a transaction
79+ ### Specifying whether SQL files will be wrapped in a transaction
6480
6581``` toml
6682# .squawk.toml
6783assume_in_transaction = true
6884```
6985
70- ### using all options
86+ ### Using all options
7187
7288``` toml
7389# .squawk.toml
0 commit comments