diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-25 14:29:09 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-25 14:29:09 -0500 |
| commit | 4dc1d11a627a571eeae4e0ae3da7b94e7de04214 (patch) | |
| tree | fee0c2657ffb9d298305fa775ff4abd24cfd6c54 /src/flake8/statistics.py | |
| parent | fc035c4df280e1f10c2e1f73ce8c2ea2af5c99a7 (diff) | |
| download | flake8-bug/180.tar.gz | |
Wire-up --statistics againbug/180
I'm not sure where this code went or when, but it disappeared. Let's
add it back.
Related #180
Diffstat (limited to 'src/flake8/statistics.py')
| -rw-r--r-- | src/flake8/statistics.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/flake8/statistics.py b/src/flake8/statistics.py index 2512089..d35d4bf 100644 --- a/src/flake8/statistics.py +++ b/src/flake8/statistics.py @@ -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. |
