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

Method start

src/flake8/formatting/base.py:76–84  ·  view source on GitHub ↗

Prepare the formatter to receive input. This defaults to initializing :attr:`output_fd` if :attr:`filename`

(self)

Source from the content-addressed store, hash-verified

74 """
75
76 def start(self) -> None:
77 """Prepare the formatter to receive input.
78
79 This defaults to initializing :attr:`output_fd` if :attr:`filename`
80 """
81 if self.filename:
82 dirname = os.path.dirname(os.path.abspath(self.filename))
83 os.makedirs(dirname, exist_ok=True)
84 self.output_fd = open(self.filename, "a")
85
86 def handle(self, error: Violation) -> None:
87 """Handle an error reported by Flake8.

Callers 3

test_startFunction · 0.95
run_checksMethod · 0.45
reportMethod · 0.45

Calls

no outgoing calls

Tested by 1

test_startFunction · 0.76