Prompt
Remove unnecessary default parameters and consolidate related conditional logic to improve code clarity and maintainability. When parameters are always provided in practice, avoid adding default values that create false optionality. Similarly, combine related conditions into single, more readable expressions.
Examples of improvements:
- Remove default parameters that are never used: Change
def run(spec_path: Path, full_refresh: Optional[Sequence[str]] = None)todef run(spec_path: Path, full_refresh: Optional[Sequence[str]])when the parameter is always provided - Consolidate related conditions: Replace separate
if full_refresh:andif refresh:checks withif full_refresh or refresh:when they serve the same logical purpose
This approach reduces cognitive load for readers and eliminates misleading code patterns that suggest optional behavior when none exists.