fix(tooling): W013 line attribution, W019 discarded interrogatives, phantom LSP input, quiet load_file (#556 #559 #560 #583)#584
Merged
Conversation
…hantom LSP input, quiet load_file (#556 #559 #560 #583) - parser: AST_FUNC nodes carry the define token's line, not the line of the first statement after the body — W013 now lands on the define, same-line allow-pragmas match, consecutive shadows no longer chain-suppress (#556). Stepper scope fixture step index updated (the define's tape record moved to its own line). - lint: new W019 — statement-level interrogatives (question words, prev of) evaluate-and-discard; warn (#583). DIAGNOSTICS.md row added; lib/tests/examples scan clean. - eigenlsp: remove phantom 'input' completion (#559). - builtins: load_file banner gated behind EIGS_VERBOSE_LOAD, silent default (#560). Suite [115b] pins the quiet default. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Four consumer-filed tooling/diagnostics quick-wins, one per issue:
#556 — W013 attributed to the shadowing
definelineRoot cause was in the parser, not the linter:
AST_FUNCnodes were stamped withp_cur(p)->lineafterparse_blockconsumed the body, i.e. the line of the first statement following the define. Consequences (both halves of the issue): W013 pointed at innocent code, the documented same-line# lint: allow W013never matched, and consecutive shadowing defines chain-suppressed each other. The node now carries thedefinetoken's own line.Side effect (correctness improvement, one test updated): the trace tape's line record for a
definestatement now carries the define's line instead of the following statement's, sotests/test_step.sh's scope fixture lands the "inside the frame" state at step 12 instead of 11 — the hardcoded step index and comment updated. The stepper's source echo for that step was previously wrong (| i is 1shown for the define record).Regression tests: issue's repro pair (attribution line, same-line pragma) + the chain-suppression case (both of two consecutive shadows warn on their own lines) in
tests/test_lint.sh.#583 — W019: statement-level interrogative discards its result
New rule
check_disc_interroginsrc/lint.c: anyAST_INTERROGATEsitting directly in a statement list (program/if/loop/for/func/try/match/block/unobserved bodies) warns — question-word forms get the issue's suggested message shape ("question words cannot be assigned withis; as a statement its result is discarded"),prev ofgets a discarded-result message. Interrogatives inside expressions are structurally unreachable by the check — zero false positives on expression use. Documented as W019 indocs/DIAGNOSTICS.md; scanned everylib/,tests/,examples/.eigsfile — zero hits, nothing to fix. Tests: the issue's Tidepool repro (fires at the right line),prev ofstatement, and expression-position negatives.#559 — phantom
inputLSP completion removedRemoved the one unregistered entry from
builtin_docsinsrc/eigenlsp.c(the real stdin-read primitive lands via #558). Regression test intests/test_lsp.py: completion must not offer aninputlabel. NOT done: generating the completion list fromregister_builtins()itself — worth doing but a structural change beyond this sweep; the list is otherwise verified accurate by the suite's LSP checks.#560 —
load_filesilent by defaultThe unconditional
[load_file] Loading ...stderr banner is now gated behindEIGS_VERBOSE_LOAD=1(issue's preferred option: no other successful builtin announces itself; failures still surface loudly through the error path).docs/DIAGNOSTICS.mdinformational-messages section updated. Suite section [115b]: successful load emits nothing on stderr; the env var re-enables the banner.Gates
detect_leaks=1: tally 0, [87] cleanmake jit-smokegreenmake freestanding-checkgreen (builtins.c touched)tools/doc_drift_check.shrc=0Closes #556
Closes #559
Closes #560
Closes #583
🤖 Generated with Claude Code