mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
Document Legacy API
This commit is contained in:
parent
911c69f0fd
commit
ec678de427
2 changed files with 106 additions and 2 deletions
|
|
@ -156,6 +156,10 @@ class Report(object):
|
|||
There are important changes in how this object behaves compared to
|
||||
the object provided in Flake8 2.x.
|
||||
|
||||
.. warning::
|
||||
|
||||
This should not be instantiated by users.
|
||||
|
||||
.. versionchanged:: 3.0.0
|
||||
"""
|
||||
|
||||
|
|
@ -174,7 +178,15 @@ class Report(object):
|
|||
return self._application.result_count
|
||||
|
||||
def get_statistics(self, violation):
|
||||
"""Get the number of occurences of a violation."""
|
||||
"""Get the list of occurences of a violation.
|
||||
|
||||
:returns:
|
||||
List of occurrences of a violation formatted as:
|
||||
{Count} {Error Code} {Message}, e.g.,
|
||||
``8 E531 Some error message about the error``
|
||||
:rtype:
|
||||
list
|
||||
"""
|
||||
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