The codebase uses Python 3.6+ but most functions lack type hints, especially for return values. This makes the code harder to understand and prevents static type checking tools from catching bugs.
Examples
# Currentdef_get_latest_backup(backups_dir:str):"""Returns path to latest backup created in backups_dir or None."""# Should bedef_get_latest_backup(backups_dir:str)->Optional[os.DirEntry]:"""Returns path to latest backup created in backups_dir or None."""
Scope
Affects most functions across:
curateipsum/backup.py
curateipsum/fs.py
curateipsum/cli.py
Proposed Solution
Add complete type hints to all functions, including imports from typing module where needed.
# No type hints on function return values
**Priority:** Low
**Component:** All
**Type:** Code Quality
## Description
The codebase uses Python 3.6+ but most functions lack type hints, especially for return values. This makes the code harder to understand and prevents static type checking tools from catching bugs.
## Examples
```python
# Current
def _get_latest_backup(backups_dir: str):
"""Returns path to latest backup created in backups_dir or None."""
# Should be
def _get_latest_backup(backups_dir: str) -> Optional[os.DirEntry]:
"""Returns path to latest backup created in backups_dir or None."""
```
## Scope
Affects most functions across:
- `curateipsum/backup.py`
- `curateipsum/fs.py`
- `curateipsum/cli.py`
## Proposed Solution
Add complete type hints to all functions, including imports from `typing` module where needed.
## Benefits
- Better IDE autocomplete
- Static type checking with mypy
- Improved documentation
- Catch bugs earlier
## Impact
**Low** - Code quality improvement, doesn't affect runtime behavior.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No type hints on function return values
Priority: Low
Component: All
Type: Code Quality
Description
The codebase uses Python 3.6+ but most functions lack type hints, especially for return values. This makes the code harder to understand and prevents static type checking tools from catching bugs.
Examples
Scope
Affects most functions across:
curateipsum/backup.pycurateipsum/fs.pycurateipsum/cli.pyProposed Solution
Add complete type hints to all functions, including imports from
typingmodule where needed.Benefits
Impact
Low - Code quality improvement, doesn't affect runtime behavior.