MCPcopy Index your code
hub / github.com/python/cpython / fail_if_improved

Function fail_if_improved

Doc/tools/check-warnings.py:237–251  ·  view source on GitHub ↗

We may have fixed warnings in some files so that the files are now completely clean. Good news! Let's add them to .nitignore to prevent regression.

(
    files_with_expected_nits: set[str], files_with_nits: set[str]
)

Source from the content-addressed store, hash-verified

235
236
237def fail_if_improved(
238 files_with_expected_nits: set[str], files_with_nits: set[str]
239) -> int:
240 """
241 We may have fixed warnings in some files so that the files are now completely clean.
242 Good news! Let's add them to .nitignore to prevent regression.
243 """
244 files_with_no_nits = files_with_expected_nits - files_with_nits
245 if files_with_no_nits:
246 print("\nCongratulations! You improved:\n")
247 for filename in sorted(files_with_no_nits):
248 print(filename)
249 print("\nPlease remove from Doc/tools/.nitignore\n")
250 return -1
251 return 0
252
253
254def fail_if_new_news_nit(warnings: list[str], threshold: int) -> int:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…