Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kkkaan/general-clang-format
A general .clang-format file, with most of the configurations, for auto formatting your code.
https://github.com/kkkaan/general-clang-format
c clang cpp llvm
Last synced: 4 months ago
JSON representation
A general .clang-format file, with most of the configurations, for auto formatting your code.
- Host: GitHub
- URL: https://github.com/kkkaan/general-clang-format
- Owner: kkKaan
- License: mit
- Created: 2024-02-18T14:19:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-11T09:44:18.000Z (7 months ago)
- Last Synced: 2024-09-30T03:41:04.032Z (4 months ago)
- Topics: c, clang, cpp, llvm
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://google.github.io/styleguide/cppguide.html), and [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).
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](https://clang.llvm.org/extra/clang-tidy/checks/list.html).
## 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](https://clang.llvm.org/extra/clang-tidy/) 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](https://clang.llvm.org/docs/ClangFormatStyleOptions.html).