-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a flag & config for skipping path glob patterns (#350)
Adding a CLI flag as well as a field in the config file for skipping paths using glob patterns. This is useful for introducing the linter on an already live service which had linter warnings on previous migrations.
- Loading branch information
1 parent
fa0ec26
commit d2a8e26
Showing
16 changed files
with
127 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "squawk" | ||
version = "0.28.0" | ||
version = "0.29.0" | ||
authors = ["Steve Dignam <[email protected]>"] | ||
edition = "2018" | ||
license = "GPL-3.0" | ||
|
@@ -27,6 +27,7 @@ squawk-parser = { version = "0.0.0", path = "../parser" } | |
squawk-linter = { version = "0.0.0", path = "../linter" } | ||
squawk-github = { version = "0.0.0", path = "../github" } | ||
toml = "0.5.9" | ||
glob = "0.3.1" | ||
|
||
[dev-dependencies] | ||
insta = "0.16.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
cli/src/snapshots/squawk__config__test_config__load_assume_in_transaction.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
cli/src/snapshots/squawk__config__test_config__load_cfg_full.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
cli/src/snapshots/squawk__config__test_config__load_excluded_paths.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
source: cli/src/config.rs | ||
expression: "Config::parse(Some(squawk_toml.path().to_path_buf()))" | ||
|
||
--- | ||
Ok( | ||
Some( | ||
Config { | ||
excluded_paths: [ | ||
"example.sql", | ||
], | ||
excluded_rules: [], | ||
pg_version: None, | ||
assume_in_transaction: None, | ||
}, | ||
), | ||
) |
2 changes: 2 additions & 0 deletions
2
cli/src/snapshots/squawk__config__test_config__load_excluded_rules.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
cli/src/snapshots/squawk__config__test_config__load_pg_version.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "squawk-cli", | ||
"version": "0.28.0", | ||
"version": "0.29.0", | ||
"description": "linter for PostgreSQL, focused on migrations", | ||
"repository": "[email protected]:sbdchd/squawk.git", | ||
"author": "Steve Dignam <[email protected]>", | ||
|