Configuration files for LLVM's clang-format automatic source code formatter and LLVM's clang-tidy automatic source code linter.
I created these configuration files for use in my personal software projects. These files are licensed under the MIT license, so you may use them in your software projects subject to the terms of the license. For more information about the MIT license, see the LICENSE file or visit https://mit-license.org. For more information about LLVM's clang-format, visit https://clang.llvm.org/docs/ClangFormat.html. For more information about LLVM's clang-tidy, visit https://clang.llvm.org/extra/clang-tidy
Contents:
The configuration files are available for different versions of clang-format:
- clang-format Configuration File for Version 18.0.0
- clang-format Configuration File for Version 17.0.0
- clang-format Configuration File for Version 16.0.0
- clang-format Configuration File for Version 15.0.0
- clang-format Configuration File for Version 14.0.0
- clang-format Configuration File for Version 13.0.0
- clang-format Configuration File for Version 12.0.0
- clang-format Configuration File for Version 11.0.0
On Ubuntu, install clang-format with:
sudo apt install clang-format
Check the version of clang-format with:
clang-format --version
Format your source code files with:
clang-format --style=file:/path/to/configuration/file /path/to/source/code/files
Alternatively, if you place a clang-format configuration file named .clang-format
in the root directory of your source code repository, you can format your source code files with:
clang-format --style=file /path/to/source/code/files
Additionally, most modern integrated development environments support source code formatting with clang-format directly within their user interface; consult your environment's documentation for more details.
The configuration file can be used with any version of clang-tidy:
On Ubuntu, install clang-tidy with:
sudo apt install clang-tidy
Lint your source code files with:
clang-tidy --config-file=/path/to/configuration/file --extra-arg=-std=c++20 /path/to/source/code/files
Alternatively, if you place a clang-tidy configuration file named .clang-tidy
in the root directory of your source code repository, you can lint your source code files with:
clang-tidy --extra-arg=-std=c++20 /path/to/source/code/files
Additionally, most modern integrated development environments support source code linting with clang-tidy directly within their user interface; consult your environment's documentation for more details.