Skip to content

Instantly share code, notes, and snippets.

@wader
Created January 9, 2016 17:45
Show Gist options
  • Save wader/56649546c49578f9c5b9 to your computer and use it in GitHub Desktop.
Save wader/56649546c49578f9c5b9 to your computer and use it in GitHub Desktop.
clang-format clang-tidy config
#!/bin/sh
# brew install llvm --with-clang-extra-tools --with-clang
/usr/local/Cellar/llvm/3.6.2/bin/clang-tidy -fix \
-fix-errors \
-header-filter=.* \
--checks=readability-braces-around-statements,misc-macro-parentheses \
*.c *.h \
-- -I. -I/usr/include
clang-format -i "-style={
TabWidth: 2,
UseTab: Never,
ForEachMacros: ['LIST_FOREACH', 'TAILQ_FOREACH'],
AllowShortFunctionsOnASingleLine: None,
AlignAfterOpenBracket: true,
BinPackArguments: true,
BinPackParameters: false,
BreakBeforeBinaryOperators: true,
}" \
*.c *.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment