Skip to content

clang-format and clang-tidy configuration files for automated source code formatting and linting

License

Notifications You must be signed in to change notification settings

acodcha/clang-format-tidy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clang-format and clang-tidy Configuration Files

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:

clang-format Configuration File

The configuration files are available for different versions of clang-format:

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.

(Back to Top)

clang-tidy Configuration File

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.

(Back to Top)

About

clang-format and clang-tidy configuration files for automated source code formatting and linting

Topics

Resources

License

Stars

Watchers

Forks