Skip to content

Propagate toolkit lint and format exit codes - #147

Merged
YvetteNikolov merged 2 commits into
mainfrom
copilot/fix-exit-code-in-lint-toolkit
Sep 27, 2026
Merged

YvetteNikolov merged 2 commits into
mainfrom
copilot/fix-exit-code-in-lint-toolkit

Conversation

Copilot AI commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

yard-toolkit lint and yard-toolkit format previously logged child-process failures but still exited successfully, preventing reliable CI and pre-commit checks.

  • Exit handling
    • Propagate the child process exit code through process.exitCode.
    • Treat signal termination (code === null) as exit code 1.
  • Coverage
    • Add tests for successful, failed, and signal-terminated commands.
process.exitCode = code ?? 1;

Co-authored-by: YvetteNikolov <48315669+YvetteNikolov@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix exit code handling in lint toolkit commands Propagate toolkit lint and format exit codes Sep 27, 2026
Copilot AI requested a review from YvetteNikolov September 27, 2026 15:01
@YvetteNikolov
YvetteNikolov marked this pull request as ready for review September 27, 2026 15:01
Copilot AI lite review requested due to automatic review settings September 27, 2026 15:01
@YvetteNikolov
YvetteNikolov requested a review from a team as a code owner September 27, 2026 15:01
@YvetteNikolov
YvetteNikolov merged commit 44e38e0 into main Sep 27, 2026
3 checks passed
@YvetteNikolov
YvetteNikolov deleted the copilot/fix-exit-code-in-lint-toolkit branch September 27, 2026 15:03

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.

Copilot review overview

🟡 Changes recommended

Toolkit Vitest dependencies and test-script wiring are incomplete.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR propagates toolkit lint/format exit codes and adds Vitest coverage for success, failure, and signal termination.

Changes:

  • Propagates child-process exit codes via process.exitCode.
  • Adds toolkit Vitest configuration and tests.
  • Registers toolkit tests in the root Vitest suite.
File Description
vitest.config.mjs Registers toolkit tests.
packages/​toolkit/​vitest.config.mjs Adds toolkit Vitest configuration.
packages/​toolkit/​tests/​helpers.test.js Tests exit-code propagation.
packages/​toolkit/​src/​utils/​helpers.js Propagates child-process exit codes.

Moderate findings remain: declare vitest in the toolkit package and wire its test script, updating the lockfile as needed.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +4 to +7
test: {
globals: true,
environment: 'node',
include: [ 'tests/**/*.test.js' ],
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.

@yardinternet/toolkit: lint en format eindigen altijd met exitcode 0

3 participants