GithubHelp home page GithubHelp logo

buhrmatter's Introduction

buhrmatter

A clang-format utility.

It will automatically format your C++ closer to the slightly-quirky format laid out here.

Note that the tool does not have perfect coverage; some amount of work is still necessary to make your code fully adhere to the style guide.

Disclaimer

clang-format rewrites your source-code. Make sure to have your code in a source-control system, so it can't do any permanent damage.

Instructions

 $ cd <my-project>
 $ curl "https://raw.githubusercontent.com/balasanjay/buhrmatter/master/format-style" > .clang-format
 $ clang-format -i *.h *.cc

Note that clang-format is idempotent, so you can run it as many times as you want.

Requirements

In order to use this tool, you need two things.

  • clang-format
  • A style-file (this is provided by this repo; see the curl command above)

There are three ways to get clang-format; you can use a package manager, build from source, or just use the provided binaries. Note that building from source can take a considerable amount of time.

Using Package Managers

With OS X and recent versions of homebrew, you can run:

brew install clang-format

Building clang-format From Source

$ cd ~
$ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
$ cd llvm/tools
$ svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
$ cd ~/llvm
$ ./configure
$ make

After executing the instructions above, clang-format will be in ~/llvm/Debug+Asserts/bin/clang-format.

Using the Provided Binaries

For OSX

For Linux (thanks, Kalsi!)

buhrmatter's People

Contributors

alykhank avatar balasanjay avatar shalecraig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.