Back to all reviewers

Use specific configuration patterns

google-gemini/gemini-cli
Based on 5 comments
Json

When defining exclusion patterns, file filters, or other configuration rules, use specific, targeted patterns rather than broad glob patterns. Overly broad patterns can lead to unintended exclusions and hard-to-debug issues in the future when legitimate files need to be included.

Configurations Json

Reviewer Prompt

When defining exclusion patterns, file filters, or other configuration rules, use specific, targeted patterns rather than broad glob patterns. Overly broad patterns can lead to unintended exclusions and hard-to-debug issues in the future when legitimate files need to be included.

For example, instead of using a broad pattern like !dist/**/*.tgz that excludes all .tgz files from any subdirectory, use a specific pattern like !dist/google-gemini-cli-core-*.tgz that targets only the intended files. This approach:

  • Makes the configuration intent explicit and self-documenting
  • Prevents accidental exclusion of legitimate files
  • Reduces maintenance risk and potential regressions
  • Avoids hard-to-debug issues when requirements change
{
  "files": [
    "dist",
    "!dist/google-gemini-cli-core-*.tgz"  // Specific pattern
  ]
}

This principle applies to all configuration contexts including package.json files arrays, .gitignore patterns, build tool configurations, and other rule-based settings.

5
Comments Analyzed
Json
Primary Language
Configurations
Category

Source Discussions