-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
When the chasten tool is run on a program with multiple files, it will produce output like this:
π Performing 12 check(s):
β id: 'CLS001', name: 'class-definition', pattern: './/ClassDef', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 1 matches
β id: 'FUNC001', name: 'all-function-definition', pattern: '//FunctionDef/body/Expr[value/Constant]/following-sibling::*[1] |
//FunctionDef/body[not(Expr/value/Constant)]/*[1]', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_lazytracker.py - 6 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_tracked.py - 2 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 6 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 3 matches
β id: 'FUNC002', name: 'all-function-definition-with-docstring', pattern: '//FunctionDef/body/Expr[value/Constant]/following-sibling::*[1]',
min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 6 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 1 matches
β id: 'FUNC003', name: 'all-function-definition-with-no-docstring', pattern: '//FunctionDef/body[not(Expr/value/Constant)]/*[1]', min=None,
max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_lazytracker.py - 6 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_tracked.py - 2 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 2 matches
β id: 'FUNC004', name: 'all-non-test-function-definition', pattern: '//FunctionDef[not(contains(@name,
"test_"))]/body/Expr[value/Constant]/following-sibling::*[1] | //FunctionDef[not(contains(@name, "test_"))]/body[not(Expr/value/Constant)]/*[1]',
min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_lazytracker.py - 2 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 6 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 3 matches
β id: 'FUNC004', name: 'all-test-function-definition', pattern: '//FunctionDef[starts-with(@name,
"test_")]/body/Expr[value/Constant]/following-sibling::*[1] | //AsyncFunctionDef[starts-with(@name,
"test_")]/body/Expr[value/Constant]/following-sibling::*[1] | //FunctionDef[starts-with(@name, "test_")]/body[not(Expr/value/Constant)]/*[1] |
//AsyncFunctionDef[starts-with(@name, "test_")]/body[not(Expr/value/Constant)]/*[1]', min=7, max=22
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_lazytracker.py - 4 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/tests/test_tracked.py - 2 matches
β id: 'CTRL001', name: 'single-nested-if-in-function', pattern: './/FunctionDef/body//If', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 1 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 7 matches
β id: 'CTRL002', name: 'single-nested-if-anywhere-in-module', pattern: './/If', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 1 matches
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/tracked.py - 7 matches
β id: 'CTRL003', name: 'double-nested-if-in-function', pattern: './/FunctionDef/body//If[ancestor::If and not(parent::orelse)]', min=None,
max=None
β id: 'CTRL004', name: 'double-nested-if-anywhere-in-module', pattern: './/If[ancestor::If and not(parent::orelse)]', min=None, max=None
β id: 'CTRL005', name: 'single-nested-for-target', pattern: './/For/target/Name', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 3 matches
β id: 'CTRL006', name: 'single-nested-for-target-no-count', pattern: './/For/target/Name', min=None, max=None
β’ /home/gkapfham/working/source/astute-subjects/subject-forks/lazytracker/lazytracker/lazytracker.py - 3 matches
β¨ Saved the file 'chasten-results-lazytracker-20230823214805-7c28a9801c25437f981cb7e2a51926f0.json'
π At least one check did not pass.
This example is small enough that it is easy to tell that, for instance,
single-nested-for-target-no-count has a total of 6 matches. However, it would
be useful if the tool's command-line output has sub-totals for the number of matches for a specific check.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request