Read file content as UTF-8 string, returning '' on missing/unreadable file.
(path: Path)
| 16 | |
| 17 | |
| 18 | def read_file(path: Path) -> str: |
| 19 | """Read file content as UTF-8 string, returning '' on missing/unreadable file.""" |
| 20 | try: |
| 21 | return path.read_text(encoding="utf-8") |
| 22 | except OSError: |
| 23 | return "" |
| 24 | |
| 25 | |
| 26 | def read_plugin_json(plugin_dir: Path) -> dict: |
no outgoing calls
no test coverage detected