Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Created November 29, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dongyuwei/8b7b89b48bae52fbcb8b3927e911187c to your computer and use it in GitHub Desktop.
Save dongyuwei/8b7b89b48bae52fbcb8b3927e911187c to your computer and use it in GitHub Desktop.
`brew install clang-format`
`clang-format -h`
`clang-format -i -style=Mozilla InputController.mm`
`clang-format -style=Mozilla -dump-config`
ref: http://tonyarnold.com/2014/05/31/autoformatting-your-code.html
@dongyuwei
Copy link
Author

Clang Format can be configured using a .clang-format file containing a series of configuration options

@dongyuwei
Copy link
Author

dongyuwei commented Dec 17, 2017

http://clang.llvm.org/docs/ClangFormatStyleOptions.html

When clang-format formats a file, it auto-detects the language using the file name. When formatting standard input or a file that doesn’t have the extension corresponding to its language, -assume-filename= option can be used to override the file name clang-format uses to detect the language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment