Repository navigation
fix: print errors without a traceback from the pip and npm cpp-linter commands - #587
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #587 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 29 29
Lines 8329 8329
=======================================
Hits 8299 8299
Misses 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2bndy5
approved these changes
Nov 17, 2026
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.
Found while testing v2.0.0-rc.26 (PyPI
2.0.0rc25, npm2.0.0-rc.24) end to end.The
cpp-linterexecutable prints an error asError: ...and exits with 1. Thecpp-lintercommands installed by pip and npm show a Python traceback or a Node.js stack trace instead, for every error, including the expected exit of the new--strict:cpp-linter-action v3 runs the pip package, so its logs show the same traceback when a run stops on an error. Two examples from today's test runs:
version: ''on macos-latest (no clang-tidy on PATH) and an emptyGITHUB_TOKEN(401).Changes
cpp_linter.cli()function is the[project.scripts]entry point. On an error it printsError: {e:?}(the same text as the executable, including the cause chain) and raisesSystemExit(1).cpp_linter.main()is unchanged and still raisesOSError, so scripts that call it see no difference.cli.jscatches the error, printsError: <message>and setsprocess.exitCode = 1.main()still throws.--stricthelp now says that thecpp-lintercommand prints the error and the bindings'main()raises it.Tests
With a wheel built from this branch (maturin, CPython 3.13,
RUST_BACKTRACEunset), in a test repo with staged files that fail some checks:cpp-linter --strictError: Some checks did not pass, exit 1 (same as the executable)cpp-linter --style=NopeError: clang-format failed on all 2 file(s) it ran on; ..., exit 1cpp-linter --boguscpp-linter(no error)python -c "cpp_linter.main([... '--strict'])"OSErrorThe new
cli.jswas run with the published2.0.0-rc.24index.js:--strictprintsError: Some checks did not passand exits 1; a normal run exits 0;--bogusexits 2.cargo fmt --check,cargo clippy -p cpp-linter-py --all-targets -- -D warningsand cspell are clean.