Skip to content

A general .clang-format file, with most of the configurations, for auto formatting your code.

License

Notifications You must be signed in to change notification settings

kkKaan/general-clang-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

General .clang-format and .clang-tidy Configurations

This repository contains a .clang-format file, which is used to configure the formatting style for C++ code using the Clang-Format tool. The configuration file specifies various formatting rules and preferences to ensure consistent and readable code across different projects. This file is created as a mixture of settings from various C++ standards, like Google C++ Style Guide, and LLVM Coding Standards.

Furthermore, there is a .clang-tidy file, which is used to configure the static analysis tool for C++ code using the Clang-Tidy tool. The configuration file specifies various static analysis rules and preferences to ensure consistent and readable code across different projects. For now, it contains 'readability-identifier-naming' checks, which are used to enforce the naming conventions for identifiers in the code. For more information about the checks, please refer to the list of these checks.

Usage

To use this .clang-format configuration file in your C++ project, follow these steps:

  1. Download: Download the .clang-format or .clang-tidy files from this repository.

  2. Integration: Place them in the root directory of your C++ project.

  3. Usage: When running Clang-Format on your C++ code, it will automatically use the formatting rules specified in the .clang-format file placed in the project directory. For clang-tidy, you can refer to the Clang-Tidy Documentation for more information on how to use it.

Configuration Details

The .clang-format file in this repository specifies formatting rules and preferences for C++ code, including:

  • Indentation settings
  • Brace wrapping preferences
  • Line breaking rules
  • Spacing and alignment options
  • Comment formatting rules
  • Code block organization preferences
  • And more...

Customization

Feel free to customize the provided .clang-format file according to your project's specific requirements and coding style preferences. You can adjust indentation widths, brace wrapping settings, spacing rules, and other formatting options to suit your needs.

With the configurations, I added the other possible choices and some small explanations for most of them, but for all other settings and more detailed information on the available formatting options and their effects, refer to the official Clang-Format documentation: Clang-Format Documentation.

About

A general .clang-format file, with most of the configurations, for auto formatting your code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages