Files
node/tools
Joyee Cheung f0c871b0c7 tools: add make format-cpp to run clang-format on C++ diffs
This patch adds a `make format-cpp` shortcut to the Makefile
that runs clang-format on the C++ diffs, and a
`make format-cpp-build` to install clang-format from
npm.

To format staged changes:

```
$ make format-cpp
```

To format HEAD~1...HEAD (latest commit):

```
$ CLANG_FORMAT_START=`git rev-parse HEAD~1` make format-cpp
```

To format diff between master and current branch head (master...HEAD):

```
$ CLANG_FORMAT_START=master make format-cpp
```

Most of the .clang-format file comes from running

```
$ clang-format --dump-config --style=Google
```

with clang-format built with llvm/trunk 328768 (npm version 1.2.3)

The clang-format version is fixed because different version of
clang-format may format the files differently.

PR-URL: https://github.com/nodejs/node/pull/21997
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-08-04 15:43:31 +02:00
..
2018-07-26 09:25:54 +02:00
2018-04-16 16:15:17 -07:00
2018-03-26 18:20:07 -04:00
2018-03-05 08:35:44 -06:00
2018-06-28 20:41:11 +02:00
2018-04-16 16:04:35 -07:00
2018-04-10 06:45:45 +09:00
2018-06-13 08:45:04 +02:00
…
…