All Projects → TheLartians → Format.cmake

TheLartians / Format.cmake

Licence: Apache-2.0 License
💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.

Programming Languages

python
139335 projects - #7 most used programming language
CMake
9771 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Format.cmake

arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (-32.98%)
Mutual labels:  lint, continuous-integration, ci, linter
makefiles
No description or website provided.
Stars: ✭ 23 (-75.53%)
Mutual labels:  lint, continuous-integration, ci, linter
Moderncppci
This is an example of doing a Modern C++ project with CI
Stars: ✭ 109 (+15.96%)
Mutual labels:  continuous-integration, ci, clang
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-60.64%)
Mutual labels:  continuous-integration, ci, linter
Moderncppstarter
🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.
Stars: ✭ 2,381 (+2432.98%)
Mutual labels:  continuous-integration, ci, clang-format
arduino-lint-action
GitHub Actions action to check Arduino projects for problems
Stars: ✭ 20 (-78.72%)
Mutual labels:  continuous-integration, ci, linter
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (+22.34%)
Mutual labels:  continuous-integration, ci, linter
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+4730.85%)
Mutual labels:  lint, ci, linter
Woke
✊ Detect non-inclusive language in your source code.
Stars: ✭ 190 (+102.13%)
Mutual labels:  lint, ci, linter
npm-groovy-lint
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
Stars: ✭ 124 (+31.91%)
Mutual labels:  lint, ci, linter
breakcheck
Backwards compatibility linter for Go.
Stars: ✭ 66 (-29.79%)
Mutual labels:  lint, ci, linter
prettier-check
Check that all files match prettier code style.
Stars: ✭ 54 (-42.55%)
Mutual labels:  lint, ci, style
flagsmith-nodejs-client
Flagsmith Node JS Client. Flagsmith lets you manage features flags across web, mobile and server side applications. Get builds out faster. Control who has access to new features.
Stars: ✭ 13 (-86.17%)
Mutual labels:  continuous-integration, ci
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-50%)
Mutual labels:  lint, linter
lint-prepush
Lint committed files on pre-push 🔬
Stars: ✭ 18 (-80.85%)
Mutual labels:  lint, linter
AutoBindings
Set of annotations that aims to make your Android development experience easier along with lint checks.
Stars: ✭ 15 (-84.04%)
Mutual labels:  lint, linter
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-81.91%)
Mutual labels:  lint, linter
JSONCustomLintr
Library to allow creation, running, and reporting of custom lint rules for JSON files
Stars: ✭ 19 (-79.79%)
Mutual labels:  lint, linter
flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (-9.57%)
Mutual labels:  lint, linter
rumi
trivago continuous integration executor
Stars: ✭ 21 (-77.66%)
Mutual labels:  continuous-integration, ci

Actions Status Actions Status

Format.cmake

clang-format and cmake-format for CMake

About

Format.cmake adds three additional targets to your CMake project.

  • format Shows which files are affected by clang-format
  • check-format Errors if files are affected by clang-format (for CI integration)
  • fix-format Applies clang-format to all affected files

To run the targets, invoke CMake with cmake --build <build directory> --target <target name>.

To disable using cmake_format to format CMake files, set the cmake option FORMAT_SKIP_CMAKE to a truthy value, e.g. by invoking CMake with -DFORMAT_SKIP_CMAKE=YES, or enabling the option when adding the dependency (recommended).

Demo

How to integrate

Using CPM.cmake (recommended)

Basic configuration

After adding CPM.cmake, add the following line to the project's CMakeLists.txt after calling project(...).

include(cmake/CPM.cmake)
CPMAddPackage("gh:TheLartians/[email protected]")

Advanced configuration

This package supports optional parameters that you can specify in the CPM.cmake OPTIONS argument.

CPMAddPackage(
  NAME Format.cmake
  VERSION 1.7.3
  GITHUB_REPOSITORY TheLartians/Format.cmake
  OPTIONS 
      # set to yes skip cmake formatting
      "FORMAT_SKIP_CMAKE NO"
      # path to exclude (optional, supports regular expressions)
      "CMAKE_FORMAT_EXCLUDE cmake/CPM.cmake"
)

Using git submodules (not suited for libraries)

Run the following from the project's root directory.

git submodule add https://github.com/TheLartians/Format.cmake

In add the following lines to the project's CMakeLists.txt after calling project(...).

add_subdirectory(Format.cmake)

Dependencies

Format.cmake requires CMake, clang-format, python 2.7 or python 3, and cmake-format (optional).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].