This repository has been archived by the owner on Sep 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 623
Formatting
Gustavo Angulo edited this page Sep 4, 2018
·
6 revisions
The source code tree includes a script (script/formatting/formatter.py) that helps with managing header comments and formatting.
You can format a single file, all files in a directory, or all files in a pre-specified directory.
The script internally uses clang-format
. You can format the source code in accordance with the style configuration file.
Example: Update the header on a single file
./script/formatting/formatter.py --update src/include/threadpool/worker_pool.h
Example: Update all files staged for commit in git
./script/formatting/formatter.py --update --staged-files
Use the --help
option to see all the available parameters.
You can add or strip headers either to/from a specific file, or all files in a specific directory, or all the files in a pre-specified directory. The code has options for these choices.