MCPcopy
hub / github.com/psf/black / done

Method done

src/black/report.py:36–50  ·  view source on GitHub ↗

Increment the counter for successful reformatting. Write out a message.

(self, src: Path, changed: Changed)

Source from the content-addressed store, hash-verified

34 failure_count: int = 0
35
36 def done(self, src: Path, changed: Changed) -> None:
37 """Increment the counter for successful reformatting. Write out a message."""
38 if changed is Changed.YES:
39 reformatted = "would reformat" if self.check or self.diff else "reformatted"
40 if self.verbose or not self.quiet:
41 out(f"{reformatted} {src}")
42 self.change_count += 1
43 else:
44 if self.verbose:
45 if changed is Changed.NO:
46 msg = f"{src} already well formatted, good job."
47 else:
48 msg = f"{src} wasn't modified on disk since last run."
49 out(msg, bold=False)
50 self.same_count += 1
51
52 def failed(self, src: Path, message: str) -> None:
53 """Increment the counter for failed reformatting. Write out a message."""

Callers 7

test_report_verboseMethod · 0.95
test_report_quietMethod · 0.95
test_report_normalMethod · 0.95
reformat_codeFunction · 0.80
reformat_oneFunction · 0.80
shutdownFunction · 0.80
schedule_formattingFunction · 0.80

Calls 1

outFunction · 0.90

Tested by 3

test_report_verboseMethod · 0.76
test_report_quietMethod · 0.76
test_report_normalMethod · 0.76