Skip to content

Commit

Permalink
fix parsing configuration file enum members (#217)
Browse files Browse the repository at this point in the history
Before we were getting this error:

```
Configuration error: Failed to parse configuration file: unknown variant `require-concurrent-index-creation`, expected one of `RequireConcurrentIndexCreation`, `RequireConcurrentIndexDeletion`, `ConstraintMissingNotValid`, `AddingFieldWithDefault`, `AddingForeignKeyConstraint`, `ChangingColumnType`, `AddingNotNullableField`, `AddingSerialPrimaryKeyField`, `RenamingColumn`, `RenamingTable`, `DisallowedUniqueConstraint`, `BanDropDatabase`, `PreferTextField`, `PreferRobustStmts`, `BanCharField`, `BanDropColumn` for key `excluded_rules` at line 1 column 1
```
  • Loading branch information
chdsbd authored Jun 15, 2022
1 parent d9bb26a commit 134d53d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## v0.13.1 - 2022-06-15

## Fixed

- fix parsing enum values from configuration file. (#217)

## v0.13.0 - 2022-06-06

## Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "squawk"
version = "0.13.0"
version = "0.13.1"
authors = ["Steve Dignam <steve@dignam.xyz>"]
edition = "2018"
license = "GPL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion cli/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ SELECT 1;
);

assert!(res.is_ok());
assert_display_snapshot!(String::from_utf8_lossy(&buff), @r###"[{"file":"main.sql","line":1,"column":0,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field requires exclusive locks and table rewrites."},{"Help":"Make the field nullable."}],"rule_name":"AddingNotNullableField"},{"file":"main.sql","line":3,"column":1,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field requires exclusive locks and table rewrites."},{"Help":"Make the field nullable."}],"rule_name":"AddingNotNullableField"}]
assert_display_snapshot!(String::from_utf8_lossy(&buff), @r###"[{"file":"main.sql","line":1,"column":0,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field requires exclusive locks and table rewrites."},{"Help":"Make the field nullable."}],"rule_name":"adding-not-nullable-field"},{"file":"main.sql","line":3,"column":1,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field requires exclusive locks and table rewrites."},{"Help":"Make the field nullable."}],"rule_name":"adding-not-nullable-field"}]
"###);
}

Expand Down
1 change: 1 addition & 0 deletions linter/src/violations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
pub use squawk_parser::ast::Span;

#[derive(Debug, PartialEq, Clone, Serialize, Hash, Eq, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum RuleViolationKind {
RequireConcurrentIndexCreation,
RequireConcurrentIndexDeletion,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squawk-cli",
"version": "0.13.0",
"version": "0.13.1",
"description": "linter for PostgreSQL, focused on migrations",
"repository": "git@github.com:sbdchd/squawk.git",
"author": "Steve Dignam <steve@dignam.xyz>",
Expand Down

0 comments on commit 134d53d

Please sign in to comment.