| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | Verify that parts of the docs match what's in the code. |
||
| 3 | """ |
||
| 4 | from __future__ import annotations |
||
| 5 | |||
| 6 | from pathlib import Path |
||
| 7 | |||
| 8 | _root = (Path(__file__).parent.parent / "mandos").absolute() |
||
| 9 | |||
| 10 | |||
| 11 | class DocSync: |
||
| 12 | def fix_api(self) -> DocSync: |
||
| 13 | for py in _root.glob("**/*.py"): |
||
| 14 | fixed = ( |
||
| 15 | " mandos." |
||
| 16 | + ( |
||
| 17 | str(py.relative_to(_root).with_suffix("")) |
||
| 18 | .replace("/", ".") |
||
| 19 | .replace("\\", ".") |
||
| 20 | .replace("__init__", "") |
||
| 21 | ) |
||
| 22 | ).rstrip(".") |
||
| 23 | print(fixed) |
||
| 24 | return self |
||
| 25 | |||
| 26 | |||
| 27 | if __name__ == "__main__": |
||
| 28 | DocSync().fix_api() |
||
| 29 |