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

Add --statistics --count? #49

Open
hugovk opened this issue Jan 10, 2019 · 4 comments
Open

Add --statistics --count? #49

hugovk opened this issue Jan 10, 2019 · 4 comments

Comments

@hugovk
Copy link
Contributor

hugovk commented Jan 10, 2019

The Python linting tool Flake8 has useful options: --statistics and --count.

Basic use

$ flake8 .
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1

With --statistics

$ flake8 . --statistics
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
1     E201 whitespace after '{'
1     E222 multiple spaces after operator
3     E265 block comment should start with '# '
2     E302 expected 2 blank lines, found 1
1     E305 expected 2 blank lines after class or function definition, found 1
18    E402 module level import not at top of file
90    E501 line too long (92 > 79 characters)
1     W293 blank line contains whitespace

With --count

$ flake8 . --count
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
117

With both

$ flake8 . --count --statistics
./interactive_console.py:5:1: E402 module level import not at top of file
<snip>
./pytumblr/helpers.py:31:1: E302 expected 2 blank lines, found 1
1     E201 whitespace after '{'
1     E222 multiple spaces after operator
3     E265 block comment should start with '# '
2     E302 expected 2 blank lines, found 1
1     E305 expected 2 blank lines after class or function definition, found 1
18    E402 module level import not at top of file
90    E501 line too long (92 > 79 characters)
1     W293 blank line contains whitespace
117

Any chance to include something like that here?

Thanks!

@DavidAnson
Copy link
Collaborator

“statistics” seems more useful to me than “count“, but both should be doable here as a post-processing step on the results from linting.

@hugovk
Copy link
Contributor Author

hugovk commented Jan 11, 2019

Thanks! I'm applying markdownlint to a project, and there's over 600 errors...

Summarising the results helps decide which group to tackle next.

(Yes, --statistics is more useful than --count, although it's still useful to get the total sometimes.)

@Guts
Copy link

Guts commented Sep 11, 2020

Any chance to see that enhancement in future versions?

@DavidAnson
Copy link
Collaborator

Just FYI, I have added something like this to markdownlint-cli2: https://www.npmjs.com/package/markdownlint-cli2-formatter-summarize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants