← Notes

Bazel BUILD Style Guide

📚 Source
🌳 Evergreen
Created: Jan 19, 2025
Updated: Jan 19, 2025

Source Information

Key Content

DAMP over DRY for BUILD Files

Bazel’s style guide recommends preferring DAMP (Descriptive and Meaningful Phrases) over DRY (Don’t Repeat Yourself) for BUILD files.

Rationale: BUILD files aren’t code, they are configurations. They aren’t tested like code, but do need to be maintained by people and tools. That makes DAMP better for them than DRY.

The DRY principle encourages uniqueness by introducing abstractions such as variables and functions to avoid redundancy in code.

In contrast, the DAMP principle encourages readability over uniqueness to make files easier to understand and maintain.

Atomic Notes


Source: Bazel BUILD Style Guide