Skip to content

Commit f2ba3b8

Browse files
authored
v2: add linter (#434)
copying over yet another crate
1 parent 7a5679e commit f2ba3b8

File tree

108 files changed

+8736
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+8736
-0
lines changed

Cargo.lock

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ camino = "1.1.9"
3434
pg_query = "6.1.0"
3535
rowan = "0.15.15"
3636
smol_str = "0.3.2"
37+
enum-iterator = "2.1.0"
38+
line-index = "0.1.2"
3739

3840
# local
3941
squawk-parser = { version = "0.0.0", path = "./crates/parser" }
4042
squawk-linter = { version = "0.0.0", path = "./crates/linter" }
4143
squawk-github = { version = "0.0.0", path = "./crates/github" }
4244
squawk_lexer = { version = "0.0.0", path = "./crates/squawk_lexer" }
4345
squawk_parser = { version = "0.0.0", path = "./crates/squawk_parser" }
46+
squawk_syntax = { version = "0.0.0", path = "./crates/squawk_syntax" }
4447

4548
[workspace.lints.clippy]
4649
collapsible_else_if = "allow"

crates/squawk_linter/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "squawk_linter"
3+
version = "0.0.0"
4+
edition.workspace = true
5+
rust-version.workspace = true
6+
authors.workspace = true
7+
license.workspace = true
8+
9+
[dependencies]
10+
squawk_syntax.workspace = true
11+
12+
rowan.workspace = true
13+
serde.workspace = true
14+
lazy_static.workspace = true
15+
insta.workspace = true
16+
enum-iterator.workspace = true
17+
line-index.workspace = true
18+
19+
20+
[lints]
21+
workspace = true

crates/squawk_linter/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# linter
2+
3+
## rules
4+
5+
| name | done? |
6+
| -------------------------------------------- | ----- |
7+
| adding_field_with_default | y |
8+
| adding_foreign_key_constraint | y |
9+
| adding_not_null_field | y |
10+
| adding_primary_key_constraint | y |
11+
| adding_required_field | y |
12+
| ban_char_field | y |
13+
| ban_concurrent_index_creation_in_transaction | y |
14+
| ban_drop_column | y |
15+
| ban_drop_database | y |
16+
| ban_drop_not_null | y |
17+
| ban_drop_table | y |
18+
| changing_column_type | y |
19+
| constraint_missing_not_valid | y |
20+
| disallow_unique_constraint | y |
21+
| prefer_big_int | y |
22+
| prefer_bigint_over_int | y |
23+
| prefer_bigint_over_smallint | y |
24+
| prefer_identity | y |
25+
| prefer_robust_stmts | y |
26+
| prefer_text_field | y |
27+
| prefer_timestamptz | y |
28+
| renaming_column | y |
29+
| renaming_table | y |
30+
| require_concurrent_index_creation | y |
31+
| require_concurrent_index_deletion | y |

0 commit comments

Comments
 (0)