Closed CalebKendra closed 11 months ago
@CalebKendra is this complete and ready for review?
@CalebKendra is this complete and ready for review?
Not yet, have to pass test cases, It will be ready by today hopefully
@CalebKendra would you be willing to paste an example output using this feature?
@CalebKendra would you be willing to paste an example output using this feature?
A pasted example as in this?
poetry run chasten analyze lazytracker --config /home/caleb/.config/chasten --search-path /home/caleb/Allegheny/CMP203/lazytracker --save-directory /home/caleb/Allegheny/CMP203/lazytracker
This command with the base config file will produce:
💫 chasten: Analyze the AST of Python Source Code
🔗 GitHub: https://github.com/gkapfham/chasten
✨ Configuration directory: /home/caleb/.config/chasten
✨ Validated /home/caleb/.config/chasten/config.yml? Yes
✨ Validated /home/caleb/.config/chasten/checks.yml? Yes
✨ Analyzing Python source code in: /home/caleb/Allegheny/CMP203/lazytracker
🎉 Performing 5 check(s):
✓ id: 'C001', name: 'class-definition', pattern: './/ClassDef', min=1, max=10
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/lazytracker.py - 1 matches
= 1 total matches
✗ id: 'F001', name: 'all-function-definition', pattern: './/FunctionDef', min=1, max=10
• /home/caleb/Allegheny/CMP203/lazytracker/tests/test_lazytracker.py - 6 matches
• /home/caleb/Allegheny/CMP203/lazytracker/tests/test_tracked.py - 2 matches
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/lazytracker.py - 6 matches
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/tracked.py - 3 matches
= 17 total matches
✗ id: 'F002', name: 'non-test-function-definition', pattern: './/FunctionDef[not(contains(@name, "test_"))]', min=1, max=10
• /home/caleb/Allegheny/CMP203/lazytracker/tests/test_lazytracker.py - 2 matches
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/lazytracker.py - 6 matches
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/tracked.py - 3 matches
= 11 total matches
✓ id: 'CL001', name: 'single-nested-if', pattern: './/FunctionDef/body//If', min=1, max=10
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/lazytracker.py - 1 matches
• /home/caleb/Allegheny/CMP203/lazytracker/lazytracker/tracked.py - 7 matches
= 8 total matches
✗ id: 'CL002', name: 'double-nested-if', pattern: './/FunctionDef/body//If[ancestor::If and not(parent::orelse)]', min=1, max=10
= 0 total matches
💻 3 / 5 checks passed (60.0%)
😓 At least one check did not pass.
Looks good to me. Thanks.
There are some conflicting files that need to be resolved before this can be merged
Previously, when you used the
analyze
command ofchasten
you got an output of: This check gives a general overview of what checks passed and didn't, but it would be a lot easier to look at this text if the total amount of checks that passed and the total amount of instances in each check were found were included in the output. This PR gives the output: This gives off the total amount of matches in each check, as well as the total amount of checks passed out of the total amount of checks.