Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide Summaries for the Counts of Checks Across All Matched Files #8

Open
gkapfham opened this issue Aug 24, 2023 · 0 comments Β· May be fixed by #96
Open

Provide Summaries for the Counts of Checks Across All Matched Files #8

gkapfham opened this issue Aug 24, 2023 · 0 comments Β· May be fixed by #96
Assignees
Labels
enhancement New feature or request

Comments

@gkapfham
Copy link
Collaborator

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.

@gkapfham gkapfham added the enhancement New feature or request label Sep 22, 2023
@hankgref hankgref self-assigned this Oct 2, 2023
@KellerLiptrap KellerLiptrap self-assigned this Oct 25, 2023
@KellerLiptrap KellerLiptrap removed their assignment Oct 31, 2023
@boulais01 boulais01 added this to the Week 15 Features milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants