mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
Wire-up --statistics again
I'm not sure where this code went or when, but it disappeared. Let's add it back. Related #180
This commit is contained in:
parent
fc035c4df2
commit
4dc1d11a62
3 changed files with 31 additions and 0 deletions
|
|
@ -9,6 +9,16 @@ class Statistics(object):
|
|||
"""Initialize the underlying dictionary for our statistics."""
|
||||
self._store = {}
|
||||
|
||||
def error_codes(self):
|
||||
"""Return all unique error codes stored.
|
||||
|
||||
:returns:
|
||||
Sorted list of error codes.
|
||||
:rtype:
|
||||
list(str)
|
||||
"""
|
||||
return list(sorted(set(key.code for key in self._store.keys())))
|
||||
|
||||
def record(self, error):
|
||||
"""Add the fact that the error was seen in the file.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue