Convert Sphinx warning messages to GitHub Actions for changed paragraphs. Converts lines like: .../Doc/library/cgi.rst:98: WARNING: reference target not found to: ::warning file=.../Doc/library/cgi.rst,line=98::reference target not found See: https://docs.githu
(
warnings: list[str], ref_a: str = "main", ref_b: str = "HEAD"
)
| 184 | |
| 185 | |
| 186 | def annotate_diff( |
| 187 | warnings: list[str], ref_a: str = "main", ref_b: str = "HEAD" |
| 188 | ) -> None: |
| 189 | """ |
| 190 | Convert Sphinx warning messages to GitHub Actions for changed paragraphs. |
| 191 | |
| 192 | Converts lines like: |
| 193 | .../Doc/library/cgi.rst:98: WARNING: reference target not found |
| 194 | to: |
| 195 | ::warning file=.../Doc/library/cgi.rst,line=98::reference target not found |
| 196 | |
| 197 | See: |
| 198 | https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message |
| 199 | """ |
| 200 | warnings_touched = process_touched_warnings(warnings, ref_a, ref_b) |
| 201 | print("Emitting doc warnings matching modified lines:") |
| 202 | for warning in warnings_touched: |
| 203 | print("::warning file={file},line={line}::{msg}".format_map(warning)) |
| 204 | print(warning[0]) |
| 205 | if not warnings_touched: |
| 206 | print("None") |
| 207 | |
| 208 | |
| 209 | def fail_if_regression( |
no test coverage detected
searching dependent graphs…