Parse ``.specify/integration.json`` without raising. Returns ``(normalized_state, None)`` on success, ``(None, None)`` when the file does not exist, or ``(None, error)`` for any parse / validation failure. This helper delegates file I/O and raw JSON validation to ``_read_integration
(
project_root: Path,
)
| 71 | |
| 72 | |
| 73 | def try_read_integration_json( |
| 74 | project_root: Path, |
| 75 | ) -> tuple[dict[str, Any] | None, IntegrationReadError | None]: |
| 76 | """Parse ``.specify/integration.json`` without raising. |
| 77 | |
| 78 | Returns ``(normalized_state, None)`` on success, ``(None, None)`` when the |
| 79 | file does not exist, or ``(None, error)`` for any parse / validation |
| 80 | failure. This helper delegates file I/O and raw JSON validation to |
| 81 | ``_read_integration_json_data`` so callers that need raw state can share |
| 82 | the same low-level reader instead of duplicating parse logic. |
| 83 | """ |
| 84 | data, error = _read_integration_json_data(project_root) |
| 85 | if data is None: |
| 86 | return None, error |
| 87 | return normalize_integration_state(data), None |
| 88 | |
| 89 | |
| 90 | def try_read_integration_json_with_raw( |
no test coverage detected