mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 07:44:16 +00:00
Use statistics in the legacy report class
This commit is contained in:
parent
14cab7e81b
commit
2ffcf96b4b
1 changed files with 6 additions and 1 deletions
|
|
@ -141,6 +141,8 @@ class Report(object):
|
||||||
.. warning:: This should not be instantiated by users.
|
.. warning:: This should not be instantiated by users.
|
||||||
"""
|
"""
|
||||||
self._application = application
|
self._application = application
|
||||||
|
self._style_guide = application.guide
|
||||||
|
self._stats = self._style_guide.stats
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def total_errors(self):
|
def total_errors(self):
|
||||||
|
|
@ -149,4 +151,7 @@ class Report(object):
|
||||||
|
|
||||||
def get_statistics(self, violation):
|
def get_statistics(self, violation):
|
||||||
"""Get the number of occurences of a violation."""
|
"""Get the number of occurences of a violation."""
|
||||||
raise NotImplementedError('Statistics capturing needs to happen first')
|
return [
|
||||||
|
'{} {} {}'.format(s.count, s.error_code, s.message)
|
||||||
|
for s in self._stats.statistics_for(violation)
|
||||||
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue