File Organization Rules

A consistent file and directory structure is crucial for navigating a large codebase. These rules enforce conventions for file naming and location.

File Naming Convention

FILE_NAMING_CONVENTION

Enforces a consistent naming convention for files. Header and source files should use `PascalCase` and have matching names (e.g., `MyClass.h` and `MyClass.cpp`).

Examples:

✅ Correct
❌ Incorrect (Lint Error)
// Consistent PascalCase naming
src/core/DatabaseConnection.h
src/core/DatabaseConnection.cpp

src/utils/StringUtils.h
src/utils/StringUtils.cpp
// Inconsistent naming styles
src/core/database_connection.h // snake_case
src/core/DatabaseConnection.cpp

src/utils/string-utils.h // kebab-case
src/utils/StringUtils.cpp

Summary

A well-organized file structure is a sign of a well-organized project:

  • Copyright First: Ensure all files have proper legal notices.

  • Consistent Naming: Make files easy to find and identify.