Skip to content

Commit 39dff36

Browse files
authored
squawk_syntax: refactor identifier out of squawk_linter (#650)
also change how we version the crates
1 parent 3fd7446 commit 39dff36

30 files changed

+63
-49
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6+
version = "2.25.1"
67
edition = "2024"
78
rust-version = "1.88.0"
89
authors = ["Squawk Team & Contributors"]
@@ -53,12 +54,12 @@ xshell = "0.2.7"
5354
proc-macro2 = "1.0.95"
5455

5556
# local
56-
squawk_github = { version = "0.0.0", path = "./crates/squawk_github" }
57-
squawk_lexer = { version = "0.0.0", path = "./crates/squawk_lexer" }
58-
squawk_parser = { version = "0.0.0", path = "./crates/squawk_parser" }
59-
squawk_syntax = { version = "0.0.0", path = "./crates/squawk_syntax" }
60-
squawk_linter = { version = "0.0.0", path = "./crates/squawk_linter" }
61-
squawk_server = { version = "0.0.0", path = "./crates/squawk_server" }
57+
squawk_github = { path = "./crates/squawk_github" }
58+
squawk_lexer = { path = "./crates/squawk_lexer" }
59+
squawk_parser = { path = "./crates/squawk_parser" }
60+
squawk_syntax = { path = "./crates/squawk_syntax" }
61+
squawk_linter = { path = "./crates/squawk_linter" }
62+
squawk_server = { path = "./crates/squawk_server" }
6263

6364
[workspace.lints.clippy]
6465
collapsible_else_if = "allow"

PLAN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ sql for benchmarks maybe?
120120

121121
https://github.com/pgvector/pgvector/blob/master/sql/vector.sql
122122

123+
- doomql
124+
125+
https://github.com/cedardb/DOOMQL
126+
123127
### CLI
124128

125129
from `deno`

crates/squawk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "squawk"
3-
version = "2.25.1"
3+
version.workspace = true
44
default-run = "squawk"
55

66
authors.workspace = true

crates/squawk/src/github.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,10 @@ fn get_summary_comment_body(
235235
file_summaries.push(summary);
236236
}
237237

238-
let summary_notice = Some("⚠️ **Large Report**: This report was summarized due to size constraints. SQL content has been omitted but all violations were analyzed.");
239-
238+
let summary_notice = Some(
239+
"⚠️ **Large Report**: This report was summarized due to size constraints. SQL content has been omitted but all violations were analyzed.",
240+
);
241+
240242
format_comment(
241243
violations_emoji,
242244
violations_count,
@@ -293,8 +295,10 @@ fn truncate_sql_if_needed(sql: &str) -> (String, bool) {
293295
if lines.len() <= MAX_SQL_PREVIEW_LINES {
294296
(sql.to_string(), false)
295297
} else {
296-
let truncated_lines = lines[..MAX_SQL_PREVIEW_LINES].join("
297-
");
298+
let truncated_lines = lines[..MAX_SQL_PREVIEW_LINES].join(
299+
"
300+
",
301+
);
298302
let remaining_lines = lines.len() - MAX_SQL_PREVIEW_LINES;
299303
(
300304
format!(

crates/squawk_github/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "squawk_github"
3-
version = "0.0.0"
3+
version.workspace = true
44
authors.workspace = true
55
edition.workspace = true
66
license.workspace = true

crates/squawk_lexer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "squawk_lexer"
3-
version = "0.0.0"
3+
version.workspace = true
44
description = "TBD"
55

66
authors.workspace = true

crates/squawk_linter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "squawk_linter"
3-
version = "0.0.0"
3+
version.workspace = true
44
edition.workspace = true
55
rust-version.workspace = true
66
authors.workspace = true

crates/squawk_linter/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ mod ignore_index;
2020
mod version;
2121
mod visitors;
2222

23-
mod identifier;
2423
mod rules;
2524

2625
#[cfg(test)]

crates/squawk_linter/src/rules/adding_field_with_default.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use lazy_static::lazy_static;
22
use std::collections::HashSet;
33

4-
use squawk_syntax::ast;
54
use squawk_syntax::ast::AstNode;
65
use squawk_syntax::{Parse, SourceFile};
6+
use squawk_syntax::{ast, identifier::Identifier};
77

8-
use crate::identifier::Identifier;
98
use crate::{Linter, Rule, Version, Violation};
109

1110
fn is_const_expr(expr: &ast::Expr) -> bool {

0 commit comments

Comments
 (0)