Python: `--threshold` is ignored with `--no-coverage`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The bug is in _threshold_status in src/crapper/cli.py around line 294, which finds no scores when --no-coverage is set and so exits 0. Reproduce with crapper --no-coverage --threshold 1 src/demo/cc.py and check the exit code. Done means either comparing the threshold against CC when coverage is off, or rejecting --threshold combined with --no-coverage, and the chosen behaviour is covered by a test.
Written by the indexing model from the issue text.
Description
With --no-coverage every CRAP is nil, _threshold_status (src/crapper/cli.py:294) finds no scores, and the run exits 0 whatever the complexity.
crapper --no-coverage --threshold 1 src/demo/cc.py; echo $? # 0, functions have CC 2-3
crapper --use-existing-coverage --threshold 1 src/demo/cov.py; echo $? # 2, as expected
cc.py and cov.py are the files from #9 and #8.
Expected: either compare the threshold with CC when coverage is off (CRAP = CC at 100% coverage is the lower bound), or reject --threshold together with --no-coverage. A silent 0 lets a gate pass that never ran.
Environment: Linux x86_64, Python 3.11.13, tree-sitter 0.26.0, tree-sitter-language-pack 1.22.1, crapper 6fd92c4.
- Dominant language
- Python
- Stars
- 255
- Forks
- 101
- Avg merge
- 7m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unclebob/crapper
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Functions missing from the coverage report score 0% with no warningPossibly taken @warxhead1 claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in unclebob/crapper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choicePossibly taken @beartester34 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelscope/evalscope#2330 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Distribution plot crashes when a numeric feature is constant in the train or test setPossibly taken @adembilge claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MAIF/shapash#847 · 1 comment ·
Maintainers usually reply within 10 days