(*, content_path: Path, new_content: Any)
| 224 | |
| 225 | |
| 226 | def update_content(*, content_path: Path, new_content: Any) -> bool: |
| 227 | old_content = content_path.read_text(encoding="utf-8") |
| 228 | |
| 229 | new_content = yaml.dump(new_content, sort_keys=False, width=200, allow_unicode=True) |
| 230 | if old_content == new_content: |
| 231 | logging.info(f"The content hasn't changed for {content_path}") |
| 232 | return False |
| 233 | content_path.write_text(new_content, encoding="utf-8") |
| 234 | logging.info(f"Updated {content_path}") |
| 235 | return True |
| 236 | |
| 237 | |
| 238 | def main() -> None: |
no outgoing calls
no test coverage detected
searching dependent graphs…