Repository navigation
fix(lint): show help before loading the compiler - #1605
Merged
Lorenzobattistela merged 2 commits intoOct 16, 2026
Merged
Conversation
Merged
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.
Problem and fix
bend-lint --helpand-hcurrently load and self-check Bend before printing usage. An unavailable or drifted compiler therefore makes help exit 2 without showing usage.Retain the parsed startup options and route help through the existing
cli()handler beforeload(). This reuses its strict argument validation and usage text; ordinary commands and library imports still load and check Bend as before.Blast radius
Two tool-owned files: six added/two removed source lines in
tools/bend-lint/src/lint.ts, plus one regression insrc/lint.test.ts. Tests remain in the tool's suite, following the #1389 guidance.No public rule/API change. Normal linting, compiler selection and drift checks retain their behavior. Help-related argument errors still exit 2, now before compiler initialization.
Regression evidence
The added subprocess test supplies a nonexistent compiler, covers both help spellings and explicit
--bend, and checks exit 0, usage stdout and empty stderr. It fails against unchanged baseline source with exit 2/no usage, and passes on this branch. An unknown-option control prevents help from bypassing strict parsing.Additional CLI controls preserve help-looking option values, real
--delimiters, explicit compiler priority, ordinary linting, drift failures and library imports.Checks
git diff --checkpasses.bend.tserrors at lines 2040 and 3771; diagnostics are byte-identical to baseline. This is not a clean typecheck.comp.tsat 64,092/64,000 ttok, also present on main's #1600 check. This PR leaves compiler source and caps untouched.Validation limits
Local checks used macOS arm64 and Bun 1.3.11 through the README-supported direct invocation. Installed-global-bin, editor integration, real release-download fallback, other operating systems and cluster checks were not exercised. The inherited compiler-cap failure prevents a green repository gate.