Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Formatting

Gustavo Angulo edited this page Sep 4, 2018 · 6 revisions

Formatting

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.

File Description Headers

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.

Automatic Formatting in Eclipse

Setup Guide

Clone this wiki locally