All Projects → Sarcasm → Run Clang Format

Sarcasm / Run Clang Format

Licence: mit
A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Run Clang Format

Moderncppci
This is an example of doing a Modern C++ project with CI
Stars: ✭ 109 (-30.57%)
Mutual labels:  clang, continuous-integration
Format.cmake
💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.
Stars: ✭ 94 (-40.13%)
Mutual labels:  continuous-integration, clang
Clang Llvm Tutorial
clang & llvm examples, e.g. AST Interpreter, Function Pointer Analysis, Value Range Analysis, Data-Flow Analysis, Andersen Pointer Analysis, LLVM Backend...
Stars: ✭ 139 (-11.46%)
Mutual labels:  clang
Compdb
The compilation database Swiss army knife
Stars: ✭ 152 (-3.18%)
Mutual labels:  clang
Tripledoggy
基于clang static analyzer的源码漏洞检测插件
Stars: ✭ 149 (-5.1%)
Mutual labels:  clang
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 (+1416.56%)
Mutual labels:  continuous-integration
Bicing Api
Get statistics and locations of bicycle stations through REST API
Stars: ✭ 149 (-5.1%)
Mutual labels:  continuous-integration
Ci Detector
Detect continuous integration environment and get information of current build
Stars: ✭ 138 (-12.1%)
Mutual labels:  continuous-integration
C
Compile and execute C "scripts" in one go!
Stars: ✭ 1,920 (+1122.93%)
Mutual labels:  clang
Fabric8
fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
Stars: ✭ 1,783 (+1035.67%)
Mutual labels:  continuous-integration
Fledge
Fledge: A CI/CD tool for Flutter
Stars: ✭ 152 (-3.18%)
Mutual labels:  continuous-integration
Keycloak Config Cli
Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Stars: ✭ 147 (-6.37%)
Mutual labels:  continuous-integration
Volkswagen
🙈 Volkswagen detects when your tests are being run in a CI server, and makes them pass.
Stars: ✭ 12,148 (+7637.58%)
Mutual labels:  continuous-integration
Arm Cmake Toolchains
CMake toolchain configurations for ARM
Stars: ✭ 148 (-5.73%)
Mutual labels:  clang
Cdeasy
Continuous Delivery made Easy ;)
Stars: ✭ 143 (-8.92%)
Mutual labels:  continuous-integration
Gitlab Ci Monitor
A simple dashboard for monitoring GitLab CI builds. Alpha version.
Stars: ✭ 152 (-3.18%)
Mutual labels:  continuous-integration
Terraform Aws Cicd
Terraform Module for CI/CD with AWS Code Pipeline and Code Build
Stars: ✭ 138 (-12.1%)
Mutual labels:  continuous-integration
Toyclangplugin
Playing with Clang plugin system
Stars: ✭ 146 (-7.01%)
Mutual labels:  clang
Terrahub
Terraform Automation and Orchestration Tool (Open Source)
Stars: ✭ 148 (-5.73%)
Mutual labels:  continuous-integration
Bear
Bear is a tool that generates a compilation database for clang tooling.
Stars: ✭ 2,345 (+1393.63%)
Mutual labels:  clang

===================== run-clang-format.py


Lint files and directories with clang-format

.. contents:: :local:

Introduction

A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration.

This is an alternative API for the clang-format command line. It runs over multiple files and directories in parallel. A diff output is produced and a sensible exit code is returned.

.. image:: screenshot.png

How to use?

Copy run-clang-format.py <run-clang-format.py>_ in your project, then run it recursively on directories, or specific files::

./run-clang-format.py -r src include foo.cpp

It's possible to exclude paths from the recursive search::

./run-clang-format.py -r
--exclude src/third_party
--exclude '*_test.cpp'
src include foo.cpp

These exclude rules can be put in a .clang-format-ignore file, which also supports comments.

An example configuration is available in this repo::

$ cat .clang-format-ignore

ignore third_party code from clang-format checks

src/third_party/*

Continuous integration

Check .travis.yml <.travis.yml>_.

For an example of failure in logs, click the badge (build is broken on purpose):

.. image:: https://travis-ci.org/Sarcasm/run-clang-format.svg?branch=master :target: https://travis-ci.org/Sarcasm/run-clang-format

FAQ

Can I check only changed files?

No, and this is what this repository was initially about. However, once working around a few shortcommings of git clang-format, I opted to try an alternative strategy which expects the whole project to be correctly formatted.

It would make sense to support this feature as well, so that the coding style does not need to be enforced but merely suggested.

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].