Skip to content

Commit

Permalink
document
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd committed May 31, 2024
1 parent bb41530 commit 542fa84
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ OPTIONS:
--dump-ast <ast-format>
Output AST in JSON [possible values: Raw, Parsed, Debug]
--exclude-path <excluded-path>...
Paths to exclude
For example: --exclude-path=005_user_ids.sql --exclude-path=009_account_emails.sql
--exclude-path='*user_ids.sql'
-e, --exclude <rule>...
Exclude specific warnings
Expand Down
14 changes: 13 additions & 1 deletion docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Individual rules can be disabled via the `--exclude` flag
squawk --exclude=adding-field-with-default,disallowed-unique-constraint example.sql
```

## files

Files can be excluded from linting via the `--exclude-path` flag. Glob matching is supported and the flag can be provided multiple times.

```shell
squawk --exclude-path=005_user_ids.sql --exclude-path='*user_ids.sql' migrations/*
```

## `.squawk.toml` configuration file

Rules can be disabled with a configuration file.
Expand All @@ -31,7 +39,7 @@ By default, Squawk will traverse up from the current directory to find a `.squaw
squawk --config=~/.squawk.toml example.sql
```

The `--exclude` and `--pg-version` flags will always be prioritized over the configuration file.
The `--exclude`, `--exclude-path`, and `--pg-version` flags will always be prioritized over the configuration file.


## example `.squawk.toml` configurations
Expand Down Expand Up @@ -70,6 +78,10 @@ excluded_rules = [
"require-concurrent-index-deletion",
]
assume_in_transaction = true
excluded_paths = [
"005_user_ids.sql",
"*user_ids.sql",
]
```


Expand Down

0 comments on commit 542fa84

Please sign in to comment.