Back to all reviewers

Modern shell syntax

neondatabase/neon
Based on 2 comments
Yaml

Prefer double brackets (`[[ ]]`) over single brackets (`[ ]`) in shell scripts for improved functionality and consistency. While double brackets don't strictly require quotes around variables, maintaining consistent quoting practice is recommended even with double brackets:

Code Style Yaml

Reviewer Prompt

Prefer double brackets ([[ ]]) over single brackets ([ ]) in shell scripts for improved functionality and consistency. While double brackets don’t strictly require quotes around variables, maintaining consistent quoting practice is recommended even with double brackets:

# Preferred style
if [[ "$variable" == "value" ]]; then
    # code
fi

# Instead of
if [ $variable == "value" ]; then
    # code
fi

This practice enhances readability and offers protection if scripts are later modified to use single brackets or embedded in contexts with stricter requirements.

2
Comments Analyzed
Yaml
Primary Language
Code Style
Category

Source Discussions