chore(lint): dedupe tree-sitter cfg gate; collapse nested else-if - #534
Merged
Conversation
…brain output Signed-off-by: Anaz S. Aji <aji.anaz@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #532
What
#![cfg(feature = "tree-sitter")]fromsrc/index/ast.rs— themod ast;declaration insrc/index/mod.rsis already cfg-gated, so the file can never be compiled without the feature anyway (finding Core CLI structure and commands (review, scan, init, auth, hook) #1 of clippy: two pre-existing -D warnings failures (block local validation with strict clippy) #532)else { if ... }wrapper in the Brain-search output block ofsrc/main.rsintoelse if ... else(finding OpenAI-compatible LLM engine (reqwest-based, streaming status) #2 of clippy: two pre-existing -D warnings failures (block local validation with strict clippy) #532, at its current location after the fix(dead-code): resolve cross-crate method calls + skip public API by default #529/feat(review): inject enclosing control-flow scope into review prompts #531 refactors shifted it)else { if !opts.quiet { ... } }site (~line 1822) is intentionally NOT collapsed: the block continues with a statement after the inner if, so collapsing would change semantics. Current clippy correctly does not flag it.Why
#532 reported two pre-existing
cargo clippy --all-targets -- -D warningsfindings that block contributors on stricter toolchains than CI's. Verification on rustc 1.97.1 showed both already lint-clean (see issue comment), so this PR applies the cleanups defensively as suggested in the issue — making the source shape match the lint bar on every toolchain, not just the current one.Testing
cargo fmt --all -- --check— cleancargo clippy --all-targets --features tree-sitter -- -D warnings— 0 warningscargo clippy --all-targets -- -D warnings— cleancargo test --features tree-sitter— 926 passed (904 unit + 16 CLI + 6 config), 0 failedNo behavior change: cfg removal only affects a file already feature-gated at its
moddeclaration; the else-if collapse is the standard clippy-validated transform.All commits signed-off (DCO).