Ensure that code elements have clear documentation explaining their purpose, behavior, and context. This includes function parameters (especially non-obvious ones), complex business logic, and magic values or constants.
Ensure that code elements have clear documentation explaining their purpose, behavior, and context. This includes function parameters (especially non-obvious ones), complex business logic, and magic values or constants.
Key areas to document:
Example from the discussions:
def add_engine_config(
self, engineType: "EngineType", secrets_origins: Optional[str]
) -> None:
"""
Configure engine with type and secrets information.
Args:
engineType: The type of engine to configure
secrets_origins: Source information for secrets detection,
e.g., "github" or "local_scan"
"""
This practice helps future developers (including yourself) understand the intent behind code decisions and reduces the cognitive load when maintaining or extending the codebase.
Enter the URL of a public GitHub repository