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

Inconsistent formatting with --format=pep8 #72

Closed
blueyed opened this issue Sep 6, 2016 · 0 comments
Closed

Inconsistent formatting with --format=pep8 #72

blueyed opened this issue Sep 6, 2016 · 0 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Sep 6, 2016

I have noticed that the formatting for "--format pep8" is inconsistent, because
it will not have a type field (E) and number:

Given t.py:

 = meh
% pylama -l  mccabe,pep8,pyflakes,pep257 --format=pep8 t.py
t.py:1:2: E111 indentation is not a multiple of four [pep8]
t.py:1:2: E113 unexpected indentation [pep8]
t.py:1:1: unexpected indent [pyflakes]

This makes it more difficult to parse (e.g. using Vim's errorformat).

With --format=pylint:

% pylama -l  mccabe,pep8,pyflakes,pep257 --format=pylint t.py
t.py:1: [D] D100: Missing docstring in public module [pep257]
t.py:1: [E] Invalid syntax: = meh [mccabe]
t.py:1: [E] unexpected indent [pyflakes]

(The same file with the "pylint" format gets different errors, which appears to
be a separate issue?! pep257 and mccabe is used here, but pep8 is not.
That happens when using pyflakes, which throws a SyntaxError from

tree = compile(code, path, "exec", _ast.PyCF_ONLY_AST)
, which causes pylama to abort. It does not depend on the format, but in which order linters get run)

blueyed added a commit to blueyed/pylama that referenced this issue Sep 6, 2016
blueyed added a commit to blueyed/pylama that referenced this issue Sep 6, 2016
Do not special-case mccabe - it is also not handled in pyflakes.

This uses 'pylama' as the linter name in this case, and also adds an
error number to it for consistency.

Fixes klen#72.
blueyed added a commit to blueyed/pylama that referenced this issue Sep 6, 2016
Do not special-case mccabe - it is also not handled in pyflakes.

This uses 'pylama' as the linter name in this case, and also adds an
error number to it for consistency.

Fixes klen#72.
@klen klen closed this as completed in #75 Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant