linter: add require-table-schema rule#1046
Conversation
👷 Deploy request for squawkhq pending review.Visit the deploys page to approve it
|
| pub fn with_all_rules() -> Self { | ||
| let rules = all::<Rule>().collect::<FxHashSet<_>>(); | ||
| let rules = all::<Rule>() | ||
| .filter(|r| !r.is_opt_in()) | ||
| .collect::<FxHashSet<_>>(); | ||
| Linter::from(rules) | ||
| } |
There was a problem hiding this comment.
How bad is this? I'm afraid that adding require-table-schema will affect many current squawk users (the linter will fail after the update).
There was a problem hiding this comment.
Yeah I think we'll want to have it disabled by default, I'm not 100% sure of people's usage patterns
There was a problem hiding this comment.
Looking at where we call with_all_rules, it's only used in the LSP Server & Playground (via Wasm)
So I think we could skip this is_opt_in method
There was a problem hiding this comment.
What about without_rules? Just always insert RequireTableSchema into exclude_set?
There was a problem hiding this comment.
Yeah I think so, without_rules is disabling the rules that are explicitly passed in
Enforce that all table DDL (CREATE TABLE, CREATE TABLE AS, ALTER TABLE, DROP TABLE) uses schema-qualified names to prevent ambiguity from search_path changes.