diff options
| author | Javier Tia <[email protected]> | 2025-09-05 14:53:44 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-09-16 13:45:00 -0600 |
| commit | 29f6db89add2a5484ac478ba93d4574bb65ee158 (patch) | |
| tree | 9f61d35b9e09709ce39e952244ef715ccb2b2111 /.gitignore | |
| parent | 1116d915965604c691a9117971cbd8a731615483 (diff) | |
clang-format: Add configuration file
Introduce .clang-format configuration file to U-Boot, providing
significant improvements over the existing scripts/Lindent approach for
C code formatting.
Benefits of clang-format over scripts/Lindent:
- More comprehensive formatting rules: While Lindent relies on the basic
'indent' tool with limited options, clang-format provides extensive
control over code formatting with 800+ configuration options
- Better handling of complex code structures: clang-format understands
modern C constructs and handles nested structures, macros, and complex
expressions more intelligently
- IDE and editor integration: Native support in major development
environments (VS Code, Vim, Emacs, etc.) enables real-time formatting
- Consistent results across environments: Eliminates variations between
different versions of 'indent' tool and system configurations
- Active maintenance: clang-format is actively developed and updated,
unlike the aging 'indent' tool
Alignment with Linux kernel practices:
Continues U-Boot alignment with Linux kernel development practices,
maintaining consistency between these closely related projects. The
Linux kernel adopted clang-format to modernize its code formatting
infrastructure and improve developer experience.
The .clang-format file is based on the Linux kernel configuration,
specifically copied from Linux kernel v6.16 tag, which itself builds
upon the initial introduction in commit d4ef8d3ff005c ("clang-format:
add configuration file").
Signed-off-by: Javier Tia <[email protected]>
Diffstat (limited to '.gitignore')
| -rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 6d85b3aa238..fa2db08dead 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ fit-dtb.blob* # # We don't want to ignore the following even if they are dot-files # +!.clang-format !.get_maintainer.* !.gitattributes !.gitignore |
