Commit Graph

2 Commits

Author SHA1 Message Date
Kai Liu
d702d8073e A script that automatically reformat affected lines
Summary:
Added a script that reformat only the affected lines in a given diff.

I planned to make that file as pre-commit hook but looks it's a little bit more difficult than I thought. Since I don't want to spend too much time on this task right now, I eventually added a "make command" to achieve this with a few additional key strokes.

Also make the clang-format solely inherited from Google's style -- there are still debates on some of the style issues, but we can address them later once we reach a consensus.

Test Plan: Did some ugly format change and ran "make format", all affected lines are formatted as expected.

Reviewers: igor, sdong, haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15147
2014-01-14 12:21:24 -08:00
Kai Liu
463086bce8 Add clang-format rules
Summary:
The rule file is forked from that in Facebook's repo.

I'll add format file for now and team members can tune the rules later.

In this patch, I made only two changes in order to be consistent with existing coding style

`SpacesBeforeTrailingComments: 2`

`ColumnLimit:     80`

Test Plan: N/A

Reviewers: igor

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15015
2014-01-02 14:32:15 -08:00