Rename style_guide.Error to style_guide.Violation

Move all Violation related methods from the StyleGuide to our Violation
class.
This commit is contained in:
Ian Cordasco 2017-06-04 07:57:28 -05:00
parent 65107a5624
commit 92c367dee4
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
9 changed files with 185 additions and 136 deletions

View file

@ -23,9 +23,10 @@ class Statistics(object):
"""Add the fact that the error was seen in the file.
:param error:
The Error instance containing the information about the violation.
The Violation instance containing the information about the
violation.
:type error:
flake8.style_guide.Error
flake8.style_guide.Violation
"""
key = Key.create_from(error)
if key not in self._store:
@ -73,7 +74,7 @@ class Key(collections.namedtuple('Key', ['filename', 'code'])):
@classmethod
def create_from(cls, error):
"""Create a Key from :class:`flake8.style_guide.Error`."""
"""Create a Key from :class:`flake8.style_guide.Violation`."""
return cls(
filename=error.filename,
code=error.code,
@ -115,7 +116,7 @@ class Statistic(object):
@classmethod
def create_from(cls, error):
"""Create a Statistic from a :class:`flake8.style_guide.Error`."""
"""Create a Statistic from a :class:`flake8.style_guide.Violation`."""
return cls(
error_code=error.code,
filename=error.filename,