File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -212,4 +212,21 @@ create table users (
212212 let errors = linter. lint ( parse, sql) ;
213213 assert_eq ! ( errors. len( ) , 1 ) ;
214214 }
215+
216+ #[ test]
217+ fn regression_unknown_name ( ) {
218+ let mut linter = Linter :: with_all_rules ( ) ;
219+ let sql = r#"
220+ -- squawk-ignore prefer-robust-stmts
221+ create table test_table (
222+ -- squawk-ignore prefer-timestamp-tz
223+ created_at timestamp default current_timestamp,
224+ other_field text
225+ );
226+ "# ;
227+
228+ let parse = squawk_syntax:: SourceFile :: parse ( sql) ;
229+ let errors = linter. lint ( parse, sql) ;
230+ assert_eq ! ( errors. len( ) , 0 ) ;
231+ }
215232}
Original file line number Diff line number Diff line change @@ -136,7 +136,9 @@ impl TryFrom<&str> for Rule {
136136 "prefer-identity" => Ok ( Rule :: PreferIdentity ) ,
137137 "prefer-robust-stmts" => Ok ( Rule :: PreferRobustStmts ) ,
138138 "prefer-text-field" => Ok ( Rule :: PreferTextField ) ,
139+ // this is typo'd so we just support both
139140 "prefer-timestamptz" => Ok ( Rule :: PreferTimestampTz ) ,
141+ "prefer-timestamp-tz" => Ok ( Rule :: PreferTimestampTz ) ,
140142 "ban-char-field" => Ok ( Rule :: BanCharField ) ,
141143 "ban-drop-column" => Ok ( Rule :: BanDropColumn ) ,
142144 "ban-drop-table" => Ok ( Rule :: BanDropTable ) ,
You can’t perform that action at this time.
0 commit comments