Back to all reviewers

Document parameter choices

neondatabase/neon
Based on 2 comments
Python

Always add explanatory comments for parameters or configuration options that aren't self-explanatory from their names or context. These comments should explain:

Documentation Python

Reviewer Prompt

Always add explanatory comments for parameters or configuration options that aren’t self-explanatory from their names or context. These comments should explain:

  1. What the parameter does
  2. Why a specific value was chosen
  3. What different values would mean (especially in tests with multiple modes)

This helps future developers understand your reasoning and the implications of parameter choices.

Examples:

# Good - explains why retry_on_failures is needed
env.storage_controller.reconcile_until_idle(timeout_secs=60, retry_on_failures=True)  # retry_on_failures needed because reconciliation may encounter transient errors during split operations

# Good - explains test parameters
@pytest.mark.parametrize("with_compute_ctl", [False, True], ids=["standard", "compute-ctl"])
# with_compute_ctl: Tests prewarm behavior both with and without compute controller integration
def test_lfc_prewarm(neon_simple_env: NeonEnv, with_compute_ctl: bool):
    ...

Especially important for:

  • Boolean flags (the reason for enabling/disabling)
  • Magic numbers (why this specific value)
  • Test parameters (what aspect each parameter tests)
  • Configuration options with non-default values
2
Comments Analyzed
Python
Primary Language
Documentation
Category

Source Discussions