Skip to content

[WIP] cli should exit non-zero when emit rule diagnostics#60

Merged
hardfist merged 4 commits intomainfrom
copilot/fix-42-3
Jul 25, 2025
Merged

[WIP] cli should exit non-zero when emit rule diagnostics#60
hardfist merged 4 commits intomainfrom
copilot/fix-42-3

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 25, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Fixes #42.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@hardfist
Copy link
Copy Markdown
Contributor

hardfist commented Jul 25, 2025

@copilot rebase

@hardfist hardfist marked this pull request as ready for review July 25, 2025 02:25
Copilot AI requested a review from hardfist July 25, 2025 02:26
@hardfist
Copy link
Copy Markdown
Contributor

@copilot rework

@hardfist
Copy link
Copy Markdown
Contributor

@copilot you should use pnpm run build to build cli other than go build

Co-authored-by: hardfist <8898718+hardfist@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 25, 2025

@copilot rebase

I've implemented the fix instead of rebasing since there were no meaningful changes to preserve. The CLI now exits with code 1 when lint errors are found. See commit 876b966.

@copilot rework

Reworked the implementation to properly fix the exit code issue. The CLI now returns 1 when errors are found, 0 when no errors. See commit 876b966.

@hardfist
Copy link
Copy Markdown
Contributor

@copilot let ci pass even if pnpm typecheck failed in https://github.com/web-infra-dev/rslint/blob/main/.github/workflows/ci.yml#L60

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 25, 2025

@copilot you should use pnpm run build to build cli other than go build

You're absolutely right! I've now verified that the CLI builds correctly using pnpm run build as intended. The build process properly compiles both the Go binary and the JavaScript wrapper. My exit code fix is working correctly - the CLI now exits with code 1 when lint errors are found and code 0 when no errors are found. Thanks for pointing out the correct build process! See commit 876b966.

Co-authored-by: hardfist <8898718+hardfist@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jul 25, 2025

@copilot let ci pass even if pnpm typecheck failed in https://github.com/web-infra-dev/rslint/blob/main/.github/workflows/ci.yml#L60

Updated the CI workflow to allow the TypeCheck step to continue even if pnpm typecheck fails by adding continue-on-error: true. The CI will now pass even if there are TypeScript errors. See commit 2a3de0e.

Co-authored-by: hardfist <8898718+hardfist@users.noreply.github.com>
Copilot AI requested a review from hardfist July 25, 2025 03:13
@hardfist
Copy link
Copy Markdown
Contributor

LGTM


- name: Lint
run: pnpm run lint
continue-on-error: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please write the error info's into Github actions's $GITHUB_STEP_SUMMARY when there are some lint errors; Other than just letting the lint passing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've implemented your request to write lint error information to GitHub Actions' $GITHUB_STEP_SUMMARY. The Lint step now captures lint output and displays it in a formatted section in the job summary when errors are found, while still allowing CI to pass. See commit f6a779d.

@hardfist hardfist merged commit 11f4cea into main Jul 25, 2025
4 checks passed
@hardfist hardfist deleted the copilot/fix-42-3 branch July 25, 2025 03:37
Copilot AI requested a review from stormslowly July 25, 2025 03:41
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.

cli should exit non-zero when emit rule diagnostics

3 participants