Repository navigation
Make bare @nothrow mute both its own line and the next (#3) - #4
Merged
Merged
Conversation
The bare directive now works both trailing a statement and on its own line above one. The explicit forms are unchanged and remain the way to target exactly one line: @nothrow-line mutes only the directive's line, @nothrow-next-line mutes only the following line. Update fixtures to cover the new bare-above case, the explicit-form negative controls, and the spill-over pitfall (a trailing bare @nothrow also mutes the following line). Bump packages to 0.3.0. Claude-Session: https://claude.ai/code/session_01UG7WqvjcBWuMRj24ssFSrd Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the @nothrow muting semantics in the core analyzer so that the bare directive mutes both its own line and the following line, enabling it to work either trailing a statement or on a standalone line immediately above a statement. It also updates documentation, fixtures/tests to cover the new behavior (including explicit-form “negative controls”), and bumps package versions to 0.3.0.
Changes:
- Update
collectMutedLinesso bare@nothrowmutes both the directive line and the next line, while@nothrow-line/@nothrow-next-lineprecisely target one line. - Expand fixtures/tests to cover bare-above usage and explicit-form edge cases (including the “spill-over” pitfall).
- Bump CLI/core package versions (and CLI help/version text) to
0.3.0.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new bare @nothrow semantics and clarifies when to use explicit -line / -next-line. |
| packages/core/test/mute-fix.test.ts | Adds assertions for the new bare-above case and explicit-form negative controls. |
| packages/core/test/fixtures/muted.ts | Updates fixture cases to exercise bare-above, explicit-only behavior, and spill-over avoidance. |
| packages/core/src/analyzer.ts | Implements updated muted-line collection logic for bare vs explicit directives. |
| packages/core/package.json | Bumps @throwscript/core version to 0.3.0. |
| packages/cli/src/main.ts | Updates help text and printed version to match new muting behavior and 0.3.0. |
| packages/cli/package.json | Bumps throwscript version to 0.3.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
139
to
141
| if (parsed === "version") { | ||
| console.log("throwscript 0.2.0"); | ||
| console.log("throwscript 0.3.0"); | ||
| return 0; |
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.
The bare directive now works both trailing a statement and on its own line above one. The explicit forms are unchanged and remain the way to target exactly one line: @nothrow-line mutes only the directive's line, @nothrow-next-line mutes only the following line.
Update fixtures to cover the new bare-above case, the explicit-form negative controls, and the spill-over pitfall (a trailing bare @nothrow also mutes the following line). Bump packages to 0.3.0.
Claude-Session: https://claude.ai/code/session_01UG7WqvjcBWuMRj24ssFSrd