Skip to content

Make bare @nothrow mute both its own line and the next (#3) - #4

Merged
mirek merged 1 commit into
claude/throwscript-throws-linter-8viyaifrom
main
Jul 5, 2026
Merged

mirek merged 1 commit into
claude/throwscript-throws-linter-8viyaifrom
main

Conversation

@mirek

@mirek mirek commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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

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>
Copilot AI review requested due to automatic review settings July 5, 2026 07:22
@mirek
mirek merged commit 077e719 into claude/throwscript-throws-linter-8viyai Jul 5, 2026
1 check passed
@mirek
mirek deleted the main branch July 5, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 collectMutedLines so bare @nothrow mutes both the directive line and the next line, while @nothrow-line / @nothrow-next-line precisely 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 thread packages/cli/src/main.ts
Comment on lines 139 to 141
if (parsed === "version") {
console.log("throwscript 0.2.0");
console.log("throwscript 0.3.0");
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants