Prompt
Maintain consistent formatting and use concise, standard syntax throughout the codebase. This includes several specific formatting rules:
- Preprocessor directives: Do not add spaces after the
#symbol - Indentation: Use consistent indentation sizes (e.g., 2 spaces for C/C++ files)
- Shell variables: Avoid wrapping variables in double quotes when it breaks parameter expansion
- String operations: Use concise operators and built-in language features over verbose alternatives
- Conditional operators: Prefer concise test operators (e.g.,
-ninstead of! -z)
Examples:
// Good - no space after #
#pragma warning(push)
#pragma GCC diagnostic push
// Bad - space after #
# pragma warning(push)
# pragma GCC diagnostic push
// Good - concise string concatenation
auto path = binary_directory + "/" + filename;
// Bad - verbose string construction
auto path = binary_directory + std::string("/") + std::string(filename);
# Good - concise test operator
if [[ -n "$variable" ]]; then
# Bad - verbose test combination
if [[ ! -z "$variable" ]]; then
These formatting preferences improve code readability and maintain consistency across different languages and contexts in the codebase.