From bbbab6f0fb57f5e473aa5e73de982e3ea6f8c291 Mon Sep 17 00:00:00 2001 From: Pritesh Date: Mon, 16 Feb 2026 21:17:30 +0530 Subject: [PATCH 1/2] Fix workspace test failures and refresh parser snapshots --- AUDIT_REPORT.md | 127 ++++++++++++++++++ crates/parser/src/syntax_kind/generated.rs | 2 +- .../syntax/snapshots/parser/ok/do_block.snap | 2 +- .../snapshots/parser/ok/if_else_stmt.snap | 2 +- .../snapshots/parser/ok/if_elseif_stmt.snap | 6 +- .../snapshots/parser/ok/index_expr.snap | 4 +- .../snapshots/parser/ok/method_call.snap | 4 +- .../snapshots/parser/ok/numeric_for_stmt.snap | 2 +- crates/syntax/src/lua_lexer.rs | 2 +- 9 files changed, 139 insertions(+), 12 deletions(-) create mode 100644 AUDIT_REPORT.md diff --git a/AUDIT_REPORT.md b/AUDIT_REPORT.md new file mode 100644 index 0000000..61db079 --- /dev/null +++ b/AUDIT_REPORT.md @@ -0,0 +1,127 @@ +# Full Audit Report + +## Scope and commands run +- Read `README.md`. +- Checked for `CONTRIBUTING.md` (none found). +- Reviewed project directory layout. +- Ran: + - `cargo test --workspace` + - `cargo check --workspace` + - `cargo clippy --workspace --all-targets` + - `rg -n "TODO|FIXME|HACK"` + - `cargo tree -d` + - `cargo outdated -R` (not installed) + - `cargo audit` (not installed) + +## Findings (sorted by safest/easiest first) + +### 1) Typo breaks builds (safe to fix) +- **File:** `crates/parser/src/syntax_kind/generated.rs:12` +- **Issue:** `#[doc(hiddent)]` is misspelled; should be `hidden`. +- **Severity:** **significant** (hard build blocker) +- **Safe, non-controversial fix?** **Yes** +- **Impact:** Causes `cargo check`, `cargo test`, and `cargo clippy` to fail before most of the workspace is compiled. + +### 2) Deprecated Cargo config filename (safe to fix) +- **File:** `.cargo/config:1` +- **Issue:** Cargo warns that `.cargo/config` is deprecated in favor of `.cargo/config.toml`. +- **Severity:** **trivial** +- **Safe, non-controversial fix?** **Yes** +- **Impact:** Tooling warning on every Cargo invocation. + +### 3) Stale TODO/FIXME/HACK comments (mostly safe to address incrementally) +- **File:** `crates/parser/src/event.rs:5` + - `TODO: add node error event` + - Severity: **moderate** + - Safe fix: **Yes**, if scoped to parser error-node model. +- **File:** `crates/parser/src/grammar/statements.rs:49` + - `TODO: need to allow global assignment also` + - Severity: **significant** (language correctness gap) + - Safe fix: **No** (behavioral/parser changes need design agreement). +- **File:** `crates/lua-analyzer/src/reload.rs:29` + - `TODO: register dynamic cap` + - Severity: **moderate** + - Safe fix: **No** (protocol behavior change). +- **File:** `crates/text_edit/src/lib.rs:114` + - `FIXME: mutate text in-place or reuse memory` + - Severity: **trivial** (perf) + - Safe fix: **Yes**, if micro-optimized without API changes. +- **File:** `crates/text_edit/src/lib.rs:120` + - `FIXME: can be done without allocating intermediate vector` + - Severity: **trivial** (perf) + - Safe fix: **Yes**. +- **File:** `crates/lua-analyzer/src/diagnostics.rs:8` + - `FIXME: should be FxHashMap>` + - Severity: **moderate** + - Safe fix: **No** (type/model refactor). +- **File:** `crates/lua-analyzer/src/diagnostics.rs:10` + - `FIXME: should be Vec` + - Severity: **moderate** + - Safe fix: **No** (pipeline refactor). +- **File:** `crates/syntax/src/lib.rs:125` + - `FIXME: validation errors are not handled here` + - Severity: **significant** (may hide incremental-parse validation issues) + - Safe fix: **No** (parsing behavior risk). + +### 4) Lint warnings in proc-macro crate (safe to fix) +- **File:** `lib/binding_powers_impl/src/lib.rs:34` + - Clippy: `from_over_into` (`impl Into` should be `impl From`). + - Severity: **trivial** + - Safe fix: **Yes**. +- **File:** `lib/binding_powers_impl/src/lib.rs:40` + - Clippy: `non_canonical_partial_ord_impl`. + - Severity: **trivial** + - Safe fix: **Yes**. + +### 5) Additional parser warnings (mostly safe, but lower priority than build blocker) +- **File:** `crates/parser/src/grammar/expressions.rs:197` + - Clippy: needless `return`. + - Severity: **trivial** + - Safe fix: **Yes**. +- **File:** `crates/parser/src/grammar/expressions.rs:214` + - Clippy: needless `return`. + - Severity: **trivial** + - Safe fix: **Yes**. +- **File:** `crates/parser/src/parser.rs:34` + - Rust warning: confusing lifetime elision in return type (`Parser<'_>` explicit suggestion). + - Severity: **trivial** + - Safe fix: **Yes**. +- **File:** `crates/parser/src/parser.rs:8,110,163,189,218,219,257,271,280` and `crates/parser/src/grammar.rs:14,25` + - Rust warnings: dead code / unused items. + - Severity: **trivial** to **moderate** depending on intended roadmap. + - Safe fix: **Mixed** (may represent planned parser paths). + +### 6) Test failures, skipped tests, and low-coverage risk +- **Failing tests/build:** `cargo test --workspace` fails at compile time due to `#[doc(hiddent)]` typo. + - Primary file: `crates/parser/src/syntax_kind/generated.rs:12`. + - Severity: **significant**. + - Safe fix: **Yes**. +- **Skipped tests:** No explicit `#[ignore]`/skip output was observed before failure; test execution is blocked by compile error. + - Severity: **moderate** (unknown runtime status). + - Safe fix: **Yes** (fix compile blocker first). +- **Low-coverage areas (structural):** many crates have no in-crate tests (`base_db`, `hir`, `ide`, `parser`, `stdx`, `text_edit`, `vfs`, `accept`, `binding_powers_impl`, `xtask` etc.). + - Severity: **moderate**. + - Safe fix: **Yes** (add focused unit tests is low risk). + +### 7) Dependency and vulnerability audit limitations +- **Outdated dependencies:** could not run `cargo outdated` because command is not installed; installing it failed due network 403 while fetching crates.io index. +- **Vulnerabilities:** could not run `cargo audit` because command is not installed; installing it failed due the same network 403. +- **Duplicate dependency pressure:** `cargo tree -d` reports no duplicates in current resolution. +- **Severity:** **moderate** (visibility gap, not proven vulnerability) +- **Safe, non-controversial fix?** **Yes** (run `cargo outdated`/`cargo audit` in CI or a network-enabled dev environment). + +### 8) Documentation gaps +- **Missing `CONTRIBUTING.md`:** repository has no contributing guide. + - Severity: **trivial**. + - Safe fix: **Yes**. +- **README appears stale/minimal for current workspace complexity:** + - States parser is only partially implemented and “Please don't use this yet,” while repository includes multiple analysis/database crates and LSP plumbing. + - No contributor workflow for tests/linting/xtask commands. + - Severity: **moderate**. + - Safe fix: **Yes** (expand README with status, architecture, and contributor commands). + +### 9) Additional typos/wording issues +- **File:** `crates/parser/src/grammar.rs:84` + - Message says “expected a name referencer” (awkward wording; likely should be “reference”). + - Severity: **trivial**. + - Safe fix: **Yes**. diff --git a/crates/parser/src/syntax_kind/generated.rs b/crates/parser/src/syntax_kind/generated.rs index 52027b6..3c9f114 100644 --- a/crates/parser/src/syntax_kind/generated.rs +++ b/crates/parser/src/syntax_kind/generated.rs @@ -9,7 +9,7 @@ pub enum SyntaxKind { Tombstone, #[doc(hidden)] Eof, - #[doc(hiddent)] + #[doc(hidden)] Unknown, Bang, Hash, diff --git a/crates/syntax/snapshots/parser/ok/do_block.snap b/crates/syntax/snapshots/parser/ok/do_block.snap index 800a54d..7064db5 100644 --- a/crates/syntax/snapshots/parser/ok/do_block.snap +++ b/crates/syntax/snapshots/parser/ok/do_block.snap @@ -54,7 +54,7 @@ SourceFile@0..102 LParen@67..68 "(" MultivalExpr@68..82 Literal@68..82 - Str@68..82 "\'hello person\'" + Str@68..82 "'hello person'" RParen@82..83 ")" Whitespace@83..88 "\n " EndKw@88..91 "end" diff --git a/crates/syntax/snapshots/parser/ok/if_else_stmt.snap b/crates/syntax/snapshots/parser/ok/if_else_stmt.snap index 83a8b01..fc4f2e7 100644 --- a/crates/syntax/snapshots/parser/ok/if_else_stmt.snap +++ b/crates/syntax/snapshots/parser/ok/if_else_stmt.snap @@ -53,7 +53,7 @@ SourceFile@0..83 LParen@62..63 "(" MultivalExpr@63..77 Literal@63..77 - Str@63..77 "\'yes was true\'" + Str@63..77 "'yes was true'" RParen@77..78 ")" Whitespace@78..79 "\n" EndKw@79..82 "end" diff --git a/crates/syntax/snapshots/parser/ok/if_elseif_stmt.snap b/crates/syntax/snapshots/parser/ok/if_elseif_stmt.snap index f9d6fe3..9950a1e 100644 --- a/crates/syntax/snapshots/parser/ok/if_elseif_stmt.snap +++ b/crates/syntax/snapshots/parser/ok/if_elseif_stmt.snap @@ -69,7 +69,7 @@ SourceFile@0..166 LParen@80..81 "(" MultivalExpr@81..95 Literal@81..95 - Str@81..95 "\'yes was true\'" + Str@81..95 "'yes was true'" RParen@95..96 ")" Whitespace@96..97 "\n" ElseIfBranch@97..161 @@ -102,7 +102,7 @@ SourceFile@0..166 LParen@127..128 "(" MultivalExpr@128..139 Literal@128..139 - Str@128..139 "\'yes was 2\'" + Str@128..139 "'yes was 2'" RParen@139..140 ")" Whitespace@140..141 "\n" ElseBranch@141..161 @@ -119,7 +119,7 @@ SourceFile@0..166 LParen@153..154 "(" MultivalExpr@154..160 Literal@154..160 - Str@154..160 "\'else\'" + Str@154..160 "'else'" RParen@160..161 ")" Whitespace@161..162 "\n" EndKw@162..165 "end" diff --git a/crates/syntax/snapshots/parser/ok/index_expr.snap b/crates/syntax/snapshots/parser/ok/index_expr.snap index 4fce539..0112c5d 100644 --- a/crates/syntax/snapshots/parser/ok/index_expr.snap +++ b/crates/syntax/snapshots/parser/ok/index_expr.snap @@ -111,7 +111,7 @@ SourceFile@0..191 LParen@134..135 "(" MultivalExpr@135..142 Literal@135..142 - Str@135..142 "\'hello\'" + Str@135..142 "'hello'" RParen@142..143 ")" Whitespace@143..144 " " EndKw@144..147 "end" @@ -142,7 +142,7 @@ SourceFile@0..191 Index@179..188 LBracket@179..180 "[" Literal@180..187 - Str@180..187 "\'index\'" + Str@180..187 "'index'" RBracket@187..188 "]" CallArgs@188..190 ArgList@188..190 diff --git a/crates/syntax/snapshots/parser/ok/method_call.snap b/crates/syntax/snapshots/parser/ok/method_call.snap index 0b9413e..760576c 100644 --- a/crates/syntax/snapshots/parser/ok/method_call.snap +++ b/crates/syntax/snapshots/parser/ok/method_call.snap @@ -75,11 +75,11 @@ SourceFile@0..101 LParen@84..85 "(" MultivalExpr@85..99 Literal@85..91 - Str@85..91 "\'asdf\'" + Str@85..91 "'asdf'" Comma@91..92 "," Whitespace@92..93 " " Literal@93..99 - Str@93..99 "\'asdf\'" + Str@93..99 "'asdf'" RParen@99..100 ")" Whitespace@100..101 "\n" diff --git a/crates/syntax/snapshots/parser/ok/numeric_for_stmt.snap b/crates/syntax/snapshots/parser/ok/numeric_for_stmt.snap index 6e0fca2..2a740d4 100644 --- a/crates/syntax/snapshots/parser/ok/numeric_for_stmt.snap +++ b/crates/syntax/snapshots/parser/ok/numeric_for_stmt.snap @@ -37,7 +37,7 @@ SourceFile@0..82 LParen@27..28 "(" MultivalExpr@28..41 Literal@28..41 - Str@28..41 "\'hello world\'" + Str@28..41 "'hello world'" RParen@41..42 ")" Whitespace@42..43 "\n" EndKw@43..46 "end" diff --git a/crates/syntax/src/lua_lexer.rs b/crates/syntax/src/lua_lexer.rs index 8bc7cf0..525e516 100644 --- a/crates/syntax/src/lua_lexer.rs +++ b/crates/syntax/src/lua_lexer.rs @@ -14,7 +14,7 @@ use parser::Token; macro_rules! done { ($expr:expr) => { - return LexResult::new($expr, None); + return LexResult::new($expr, None) }; } From e2f390c262182697530db26e4bbc291631eecdf3 Mon Sep 17 00:00:00 2001 From: Pritesh Date: Mon, 16 Feb 2026 21:18:43 +0530 Subject: [PATCH 2/2] Delete AUDIT_REPORT.md --- AUDIT_REPORT.md | 127 ------------------------------------------------ 1 file changed, 127 deletions(-) delete mode 100644 AUDIT_REPORT.md diff --git a/AUDIT_REPORT.md b/AUDIT_REPORT.md deleted file mode 100644 index 61db079..0000000 --- a/AUDIT_REPORT.md +++ /dev/null @@ -1,127 +0,0 @@ -# Full Audit Report - -## Scope and commands run -- Read `README.md`. -- Checked for `CONTRIBUTING.md` (none found). -- Reviewed project directory layout. -- Ran: - - `cargo test --workspace` - - `cargo check --workspace` - - `cargo clippy --workspace --all-targets` - - `rg -n "TODO|FIXME|HACK"` - - `cargo tree -d` - - `cargo outdated -R` (not installed) - - `cargo audit` (not installed) - -## Findings (sorted by safest/easiest first) - -### 1) Typo breaks builds (safe to fix) -- **File:** `crates/parser/src/syntax_kind/generated.rs:12` -- **Issue:** `#[doc(hiddent)]` is misspelled; should be `hidden`. -- **Severity:** **significant** (hard build blocker) -- **Safe, non-controversial fix?** **Yes** -- **Impact:** Causes `cargo check`, `cargo test`, and `cargo clippy` to fail before most of the workspace is compiled. - -### 2) Deprecated Cargo config filename (safe to fix) -- **File:** `.cargo/config:1` -- **Issue:** Cargo warns that `.cargo/config` is deprecated in favor of `.cargo/config.toml`. -- **Severity:** **trivial** -- **Safe, non-controversial fix?** **Yes** -- **Impact:** Tooling warning on every Cargo invocation. - -### 3) Stale TODO/FIXME/HACK comments (mostly safe to address incrementally) -- **File:** `crates/parser/src/event.rs:5` - - `TODO: add node error event` - - Severity: **moderate** - - Safe fix: **Yes**, if scoped to parser error-node model. -- **File:** `crates/parser/src/grammar/statements.rs:49` - - `TODO: need to allow global assignment also` - - Severity: **significant** (language correctness gap) - - Safe fix: **No** (behavioral/parser changes need design agreement). -- **File:** `crates/lua-analyzer/src/reload.rs:29` - - `TODO: register dynamic cap` - - Severity: **moderate** - - Safe fix: **No** (protocol behavior change). -- **File:** `crates/text_edit/src/lib.rs:114` - - `FIXME: mutate text in-place or reuse memory` - - Severity: **trivial** (perf) - - Safe fix: **Yes**, if micro-optimized without API changes. -- **File:** `crates/text_edit/src/lib.rs:120` - - `FIXME: can be done without allocating intermediate vector` - - Severity: **trivial** (perf) - - Safe fix: **Yes**. -- **File:** `crates/lua-analyzer/src/diagnostics.rs:8` - - `FIXME: should be FxHashMap>` - - Severity: **moderate** - - Safe fix: **No** (type/model refactor). -- **File:** `crates/lua-analyzer/src/diagnostics.rs:10` - - `FIXME: should be Vec` - - Severity: **moderate** - - Safe fix: **No** (pipeline refactor). -- **File:** `crates/syntax/src/lib.rs:125` - - `FIXME: validation errors are not handled here` - - Severity: **significant** (may hide incremental-parse validation issues) - - Safe fix: **No** (parsing behavior risk). - -### 4) Lint warnings in proc-macro crate (safe to fix) -- **File:** `lib/binding_powers_impl/src/lib.rs:34` - - Clippy: `from_over_into` (`impl Into` should be `impl From`). - - Severity: **trivial** - - Safe fix: **Yes**. -- **File:** `lib/binding_powers_impl/src/lib.rs:40` - - Clippy: `non_canonical_partial_ord_impl`. - - Severity: **trivial** - - Safe fix: **Yes**. - -### 5) Additional parser warnings (mostly safe, but lower priority than build blocker) -- **File:** `crates/parser/src/grammar/expressions.rs:197` - - Clippy: needless `return`. - - Severity: **trivial** - - Safe fix: **Yes**. -- **File:** `crates/parser/src/grammar/expressions.rs:214` - - Clippy: needless `return`. - - Severity: **trivial** - - Safe fix: **Yes**. -- **File:** `crates/parser/src/parser.rs:34` - - Rust warning: confusing lifetime elision in return type (`Parser<'_>` explicit suggestion). - - Severity: **trivial** - - Safe fix: **Yes**. -- **File:** `crates/parser/src/parser.rs:8,110,163,189,218,219,257,271,280` and `crates/parser/src/grammar.rs:14,25` - - Rust warnings: dead code / unused items. - - Severity: **trivial** to **moderate** depending on intended roadmap. - - Safe fix: **Mixed** (may represent planned parser paths). - -### 6) Test failures, skipped tests, and low-coverage risk -- **Failing tests/build:** `cargo test --workspace` fails at compile time due to `#[doc(hiddent)]` typo. - - Primary file: `crates/parser/src/syntax_kind/generated.rs:12`. - - Severity: **significant**. - - Safe fix: **Yes**. -- **Skipped tests:** No explicit `#[ignore]`/skip output was observed before failure; test execution is blocked by compile error. - - Severity: **moderate** (unknown runtime status). - - Safe fix: **Yes** (fix compile blocker first). -- **Low-coverage areas (structural):** many crates have no in-crate tests (`base_db`, `hir`, `ide`, `parser`, `stdx`, `text_edit`, `vfs`, `accept`, `binding_powers_impl`, `xtask` etc.). - - Severity: **moderate**. - - Safe fix: **Yes** (add focused unit tests is low risk). - -### 7) Dependency and vulnerability audit limitations -- **Outdated dependencies:** could not run `cargo outdated` because command is not installed; installing it failed due network 403 while fetching crates.io index. -- **Vulnerabilities:** could not run `cargo audit` because command is not installed; installing it failed due the same network 403. -- **Duplicate dependency pressure:** `cargo tree -d` reports no duplicates in current resolution. -- **Severity:** **moderate** (visibility gap, not proven vulnerability) -- **Safe, non-controversial fix?** **Yes** (run `cargo outdated`/`cargo audit` in CI or a network-enabled dev environment). - -### 8) Documentation gaps -- **Missing `CONTRIBUTING.md`:** repository has no contributing guide. - - Severity: **trivial**. - - Safe fix: **Yes**. -- **README appears stale/minimal for current workspace complexity:** - - States parser is only partially implemented and “Please don't use this yet,” while repository includes multiple analysis/database crates and LSP plumbing. - - No contributor workflow for tests/linting/xtask commands. - - Severity: **moderate**. - - Safe fix: **Yes** (expand README with status, architecture, and contributor commands). - -### 9) Additional typos/wording issues -- **File:** `crates/parser/src/grammar.rs:84` - - Message says “expected a name referencer” (awkward wording; likely should be “reference”). - - Severity: **trivial**. - - Safe fix: **Yes**.