Repository navigation
Fix CLI exit status when complexity threshold is met - #122
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
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.
When
python -m mccabe --min Nprints functions meeting the threshold, it still exits successfully. Return status 1 when any function is reported, and pass that status through the module entry point. Keep status 0 for an empty report and for--dotoutput.Add subprocess coverage for all three cases and document the exit status.
Fixes #107.
Validation: the reporting regression fails on the unchanged base and all three CLI tests pass with this patch. The full suite gives 17 passed, 1 failed, 1 skipped on Python 3.12; the same
RegressionTests.test_get_module_complexityfailure occurs on unchanged master (14 passed, 1 failed, 1 skipped), wheremainalready has complexity 8 against the test's limit of 7. The optional hypothesmith test is skipped because hypothesmith is not installed. Flake8 andgit diff --checkpass.