Ensure some files always pass Sphinx nit-picky mode (no missing references). These are files which are *not* in .nitignore.
(
warnings: list[str],
files_with_expected_nits: set[str],
files_with_nits: set[str],
)
| 207 | |
| 208 | |
| 209 | def fail_if_regression( |
| 210 | warnings: list[str], |
| 211 | files_with_expected_nits: set[str], |
| 212 | files_with_nits: set[str], |
| 213 | ) -> int: |
| 214 | """ |
| 215 | Ensure some files always pass Sphinx nit-picky mode (no missing references). |
| 216 | These are files which are *not* in .nitignore. |
| 217 | """ |
| 218 | all_rst = { |
| 219 | str(rst) |
| 220 | for rst in Path("Doc/").rglob("*.rst") |
| 221 | if rst.parts[1] not in EXCLUDE_SUBDIRS |
| 222 | } |
| 223 | should_be_clean = all_rst - files_with_expected_nits - EXCLUDE_FILES |
| 224 | problem_files = sorted(should_be_clean & files_with_nits) |
| 225 | if problem_files: |
| 226 | print("\nError: must not contain warnings:\n") |
| 227 | for filename in problem_files: |
| 228 | print(filename) |
| 229 | for warning in warnings: |
| 230 | if filename in warning: |
| 231 | if match := WARNING_PATTERN.fullmatch(warning): |
| 232 | print(" {line}: {msg}".format_map(match)) |
| 233 | return -1 |
| 234 | return 0 |
| 235 | |
| 236 | |
| 237 | def fail_if_improved( |
no test coverage detected
searching dependent graphs…