Back to all reviewers

Use snake_case in Python

kubeflow/kubeflow
Based on 3 comments
Python

Follow Python's PEP 8 naming convention by using snake_case for variables, functions, and methods rather than camelCase or other styles. This enhances readability and maintains consistency across the codebase.

Naming Conventions Python

Reviewer Prompt

Follow Python’s PEP 8 naming convention by using snake_case for variables, functions, and methods rather than camelCase or other styles. This enhances readability and maintains consistency across the codebase.

According to PEP 8, variable and function names in Python should use lowercase with words separated by underscores (snake_case).

Instead of writing:

def set_notebook_memory(notebook, body, defaults):
    container = notebook["spec"]["template"]["spec"]["containers"][0]
    
    memory = get_form_value(body, defaults, "memory")
    memoryLimit = get_form_value(body, defaults, "memoryLimit")

Write:

def set_notebook_memory(notebook, body, defaults):
    container = notebook["spec"]["template"]["spec"]["containers"][0]
    
    memory = get_form_value(body, defaults, "memory")
    memory_limit = get_form_value(body, defaults, "memoryLimit")

This applies to all variable names, function names, method names, and module names in Python code. Class names should use CapWords (PascalCase) convention.

3
Comments Analyzed
Python
Primary Language
Naming Conventions
Category