• Stars
    star
    132
  • Rank 272,802 (Top 6 %)
  • Language
    Shell
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run clang-format -i on all of the files in your C or C++ project

Format All The Things!

This is a bash script that will run clang-format -i on your code.

Features:

  • Finds the right path to clang-format on Ubuntu/Debian, which encode the LLVM version in the clang-format filename
  • Fixes files recursively
  • Detects the most common file extensions used by C/C++ projects

Basic usage:

clang-format-all src/

Advanced usage:

clang-format-all project1/ project2/ project3/

Note: While clang-format is a powerful tool for enforcing a consistent coding standard, you should be aware that different versions of clang-format may format the same code differently. As one example that I know of, in C++ long vector or set literals (say, a dozen elements or more) in clang-format 3.7 are generally formatted with one entry per line, but under clang-format 3.5 the same literals may be formatted with multiple entries per line if the entries are short enough. Therefore if multiple people are contributing to the same project, you should strive to ensure that they're all using the same version of clang-format.

More Repositories

1

c.sh

Inline C/asm in Bash
Shell
249
star
2

ptrace-call-userspace

Example of how to use the ptrace(2) system call to call a userspace method.
C
133
star
3

schemaless

Implementation of the FriendFeed Schema-less MySQL Pattern
Python
86
star
4

epollet

demonstration of how to use the EPOLLET flag
C
62
star
5

demangle

Tool to demangle C++ symbols.
C++
52
star
6

tornado-dns

Asynchronous DNS lookups for Tornado
Python
50
star
7

event-clock

A simple UDP clock service, using libevent
33
star
8

coin-ticker-mode

Emacs minor mode for showing the price of Bitcoin, Ethereum, and other cryptocurrencies.
Emacs Lisp
21
star
9

utxodump

dump bitcoin utxo data
Python
17
star
10

libevent-python

me hacking on libevent-python
C
13
star
11

spv

C++ Bitcoin SPV Client
C++
12
star
12

parse-elf

An example of how to parse an ELF symbol table.
C++
11
star
13

lua-bz2

a binding to libbzip2 for lua
C
7
star
14

autoresize.jquery.js

fork of james padolsey's autoresize jquery plugin
7
star
15

oakland-crime-scraper

get oakland crime data from oakland.crimespotting.org rss feed
Python
7
star
16

garfield

A simple, fast embedded HTTP server.
C++
7
star
17

symtab

C
6
star
18

e

A text editor.
Python
6
star
19

mehfil-scraper

trivial python script that scrapes the mehfil daily menu
Lua
6
star
20

spitfire

spitfire
Python
5
star
21

python.sh

Shell
5
star
22

libattr-hs

bindings to libattr for haskell
Haskell
5
star
23

buttninjas

Implementation of the buttninja string replacement technique.
Python
4
star
24

ptrace-syscall

issue with ptrace + syscall
C
4
star
25

watchman-rpm

RPM Packaging for facebook/watchman
4
star
26

mysql-minutiae

MySQL Minutiae Presentation
4
star
27

splogger

toy logger using spread
C
4
star
28

kohlrabi

mini webapp for viewing tabular reports
Python
4
star
29

color-theme-awesome

awesome colors
Emacs Lisp
3
star
30

geoquad

python module for geoquads
C
3
star
31

mu-rpm

my rpm packaging for mu + mu4e
3
star
32

scanasm

C++
3
star
33

jump

A shell autojump utility.
Go
3
star
34

tools

C++
3
star
35

WebCrawl

web crawler in haskell
Haskell
3
star
36

mixtape

Python
3
star
37

list-unsubscribe

Helper script to unsubscribe from marketing emails.
Python
3
star
38

strutil

fast string utilities for python
C
3
star
39

old-eklitzke.org

JavaScript
3
star
40

evan-haskell-euler

my project euler solutions
Haskell
3
star
41

protolog

Structured logging system built around Google Protocol Buffers
Python
3
star
42

tf-slice

Demonstration of generating mini-batches in Tensorlfow from GPU memory.
Python
3
star
43

scribl

thread-safe statistics and counters
C
3
star
44

wlinfo

Grab Wayland info
C
3
star
45

nairobi-crypto

Presentation on Blockchains/Cryptocurrencies given to Nairobi Garage
TeX
3
star
46

radio-player

A Haskell program to play Internet radio using the new GStreamer bindings
Haskell
3
star
47

fud

a python debugger
Python
3
star
48

danger

C++
3
star
49

tornado-timeout-example

Python
2
star
50

mysql-tips

A developer's guide to MySQL
2
star
51

udp-timer

demo stm app
Haskell
2
star
52

drakebot

C++
2
star
53

hspresent

terminal presentations
Haskell
2
star
54

drifter

a simple js/canvas game
JavaScript
2
star
55

hcalc

trivial calculator in haskell
Haskell
2
star
56

icfp12

icfp12
Python
2
star
57

hackbot

a trivial irc robot (using twisted)
Python
2
star
58

lark

tiny music server
2
star
59

dnn-fastai-project

Jupyter Notebook
2
star
60

graphomatic

JavaScript
2
star
61

bogus-tornado-bench

Python
2
star
62

pnpoly

C
2
star
63

index

implementation of codesear.ch
C++
2
star
64

gst-rip

my cd ripper
2
star
65

bitcoin-tools

dumping ground for my tools
Jupyter Notebook
2
star
66

cogent

simple slice cache
C
2
star
67

associative-benchmark

a benchmark of C++ map/unorderd_map vs. Python dict
C++
2
star
68

cmemcache-yelp

some patches to cmemcache 0.94
Python
2
star
69

hanoi

Towers of Hanoi, in x86 Assembly
Assembly
2
star
70

smiley

JavaScript
2
star
71

icfp08

purely imperative python (pip)
Python
2
star
72

evan-rip

my cd ripper
2
star
73

libfk

libfk
C
2
star
74

python-lru

lru implementation
C
2
star
75

python-tempmount

Handles doing temporary mounts from Python
Python
2
star
76

popcnt.sh

Population count in Bash
Shell
2
star
77

gaia

Python wrapper of getaddrinfo_a(3)
Python
1
star
78

backup-bitcoin

Bitcoin Core backup script for Google Cloud Storage.
Shell
1
star
79

graff

graff spotting
Python
1
star
80

prometheus-node-exporter-deb

Go
1
star
81

hellocl

hello world in opencl
C
1
star
82

bitcoin-dirlocals

.dirlocals.el file for working on bitcoin from emacs
Emacs Lisp
1
star
83

inotifyreload

Python
1
star
84

bitcoin-hd-seed

Tool for extracting a Bitcoin HD wallet seed
Python
1
star
85

yelp-el

emacs stuff for yelp
Emacs Lisp
1
star
86

gh-mirror

mirror github repos
Python
1
star
87

serial-hashes

proof of concept
JavaScript
1
star
88

percona-live-2016

Slides for my Percona Live 2016 talk
TeX
1
star
89

algorithms

Python
1
star
90

ptrace-idiosyncrasy

Demonstrate an interesting idiosyncrasy of the ptrace(2) system call.
C
1
star
91

toffee

dns
Python
1
star
92

thread-bench

Simple benchmark for std::thread in C++11
C++
1
star
93

Data.ConsistentHash

Consistent hashing module for Haskell
1
star
94

stm-presentation

STM Presentation
1
star
95

scponly-rpm

1
star
96

cxx_playground

C++
1
star
97

slow.py

slowness
Python
1
star
98

eklitzke.github.com

1
star
99

mapserv

prototype of an r-tree thrift service
Python
1
star
100

offline-gpg-master-key

Shell
1
star