mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
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:
parent
65107a5624
commit
92c367dee4
9 changed files with 185 additions and 136 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue