This repository contains formatter and linter configurations for multiple programming languages. Each configuration is designed to promote consistent, readable code across different projects while following established style guides and best practices.
- clang-format: Comprehensive code formatting based on Google and LLVM style guides
- clang-tidy: Static analysis with focus on naming conventions and code quality
- Ruff: Modern, fast linter and formatter with extensive rule set
- YAPF: Google-style code formatter with detailed configuration options
common-formatters/
├── cpp/
│ ├── .clang-format # C++ code formatting rules
│ ├── .clang-tidy # C++ static analysis rules
│ └── README.md # C++ specific documentation
├── python/
│ ├── ruff.toml # Ruff configuration
│ ├── .style.yapf # YAPF configuration
│ └── README.md # Python specific documentation
└── README.md
- Copy the files from
/cpp
directory to your project root - Your editor/IDE will automatically detect and use the configurations, if you have clang working on your machine.
- See cpp/README.md for detailed usage instructions
- Copy the configuration files from
/python
directory to your project root - Install the formatter of your choice:
pip install ruff
orpip install yapf
- See python/README.md for detailed usage instructions
Contributions are welcome! If you have improvements or configurations for additional languages:
- Fork the repository
- Create a new directory for the language (if needed)
- Add configuration files with comprehensive comments, when not self-explanatory
- Include a detailed README for the language-specific directory
- Update this main README
- Submit a pull request
These configurations are built upon the guides:
- Google Style Guides
- LLVM Coding Standards
- PEP 8 -- Style Guide for Python Code
- The documentations of the formatters.