Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging in pull request #3, which adds support for pep8, and fixing a…
… few merge conflicts with the development branch
- Loading branch information
Showing
23 changed files
with
466 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
VERSION = (0, 4) | ||
version = (0, 3, 1) | ||
|
||
|
||
def get_version(): | ||
return '.'.join([str(v) for v in VERSION]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ def adapt_mccabe(self, tool): | |
|
||
def adapt_pyflakes(self, tool): | ||
pass | ||
|
||
def adapt_pep8(self, style_guide): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from prospector.formatters import json, text | ||
from prospector.formatters import json, text, grouped | ||
|
||
FORMATTERS = { | ||
'json': json.format_messages, | ||
'text': text.format_messages | ||
'text': text.format_messages, | ||
'grouped': grouped.format_messages, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import sys | ||
|
||
from collections import defaultdict | ||
|
||
from .text import _SUMMARY_TEMPLATE | ||
|
||
|
||
__all__ = ( | ||
'format_messages', | ||
) | ||
|
||
|
||
def format_messages(summary, messages): | ||
if summary: | ||
sys.stdout.write("Check Information\n=================\n") | ||
sys.stdout.write(_SUMMARY_TEMPLATE % summary) | ||
sys.stdout.write('\n\n') | ||
|
||
if not messages: | ||
return | ||
|
||
# pylint: disable=W0108 | ||
groups = defaultdict(lambda: defaultdict(list)) | ||
|
||
for message in messages: | ||
groups[message.location.path][message.location.line].append(message) | ||
|
||
sys.stdout.write("Messages\n========\n\n") | ||
for filename in sorted(groups.keys()): | ||
sys.stdout.write('%s\n' % filename) | ||
|
||
for line in sorted(groups[filename].keys(), key=lambda x: int(x)): | ||
sys.stdout.write(' Line: %s\n' % line) | ||
|
||
for msg in groups[filename][line]: | ||
sys.stdout.write( | ||
' %(source)s: %(code)s / %(message)s' % msg.as_dict(), | ||
) | ||
if msg.location.character: | ||
sys.stdout.write(' (col %s)' % msg.location.character) | ||
sys.stdout.write('\n') | ||
|
||
sys.stdout.write('\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
pylint: | ||
disable: | ||
- C0112 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
ignore: | ||
- ^tests?/? | ||
- /tests?(/|$) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,10 @@ pyflakes: | |
disable: | ||
- FL0001 | ||
- FL0013 | ||
|
||
pep8: | ||
disable: | ||
- E501 | ||
- E711 | ||
- E712 | ||
- E721 |
Oops, something went wrong.