JS: use clang-format-launcher to clang-format your project with ease
If your project is very complex, you may run into these situation:
globpattern is not enough to filter the files in your project. For example, it has a lot of generated files need to be excluded.
- The formatting is very slow.
If that’s the case, you may try clang-format-launcher which is a wrapper of clang-format, but ease you from handling complex
glob rules by yourself.
clang-format-launcher runs git ls-tree -r — name-only — full-tree HEAD first to get the list of files which is checked into, then filter the files with predefined rules in package.json or clang.format.json. Below is an example to support
npm run format to format your project and
npm run verify to verify the format in pipeline.