coala-bears
coala-bears copied to clipboard
PEP8Bear: Show PEP8 error description
Originally created by @TheMeaningfulEngineer on https://github.com/coala/coala/issues/2511
Overview Description
Coala doesn't give a description of the error what PEP8 does.
Steps to Reproduce
Files:
example.py
# After this comment there should be two lines but I'll only put one.
class Faker:
def __init__():
pass
.coafile
[Default]
bears = PEP8Bear
files = *.py
Actual Results
$ coala
Executing section Default...
example.py
| 1| #•After•this•comment•there•should•be•two•lines•but•I'll•only•put•one.
| | [NORMAL] PEP8Bear:
| | The code does not comply to PEP8.
|----| | /home/alan/europython/by_day/friday/coala_contribution/example.py
| |++++| /home/alan/europython/by_day/friday/coala_contribution/example.py
| 1| 1| # After this comment there should be two lines but I'll only put one.
| | 2|+
| 2| 3|
| 3| 4| class Faker:
| 4| 5|
| | The following actions are applicable to this result:
| | 0: Apply no further actions.
| | 1: Open the affected file(s) in an editor.
| | 2: Apply the patch automatically.
| | Please enter the number of the action you want to execute (Ctrl-D to exit).
Expected Results
It would be nice to get the error description which PEP8 gives somewhere.
$ pep8 example.py
example.py:3:1: E302 expected 2 blank lines, found 1
TL;DR Make PEP8Bear give error descriptions from PEP8 instead of just saying This code does not comply to PEP8
If I recall correctly, PEP8 allows an "issue-format" that provides more detailed messages. But then we don't have patches. Best would be to have patches and issues combined.
We would have to rather fix this for all bears that have code correcting capabilities. I bumped into another similar issue, see https://github.com/coala/coala-bears/issues/502
We would have to rather fix this for all bears that have code correcting capabilities. I bumped into another similar issue, see #502
PEP8Bear is an exception as it uses the python module directly, which is more flexible. For external linter executables this is a huge problem^^
This issue is reserved under the GSoC project Improve Generic Bear Quality.