MCPcopy
hub / github.com/PyCQA/flake8 / create_from

Method create_from

src/flake8/statistics.py:81–83  ·  view source on GitHub ↗

Create a Key from :class:`flake8.violation.Violation`.

(cls, error: Violation)

Source from the content-addressed store, hash-verified

79
80 @classmethod
81 def create_from(cls, error: Violation) -> Key:
82 """Create a Key from :class:`flake8.violation.Violation`."""
83 return cls(filename=error.filename, code=error.code)
84
85 def matches(self, prefix: str, filename: str | None) -> bool:
86 """Determine if this key matches some constraints.

Callers 5

recordMethod · 0.45
test_key_creationFunction · 0.45
test_key_matchingFunction · 0.45
test_statistic_creationFunction · 0.45
test_statistic_incrementFunction · 0.45

Calls

no outgoing calls

Tested by 4

test_key_creationFunction · 0.36
test_key_matchingFunction · 0.36
test_statistic_creationFunction · 0.36
test_statistic_incrementFunction · 0.36