Skip to content

Commit 59c6a6a

Browse files
authored
fix: git-clang-format doesn't recognize no changes requested on given files (#835)
1 parent 1427b3e commit 59c6a6a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
"predev:incremental": "node-gyp configure build -C test --debug",
304304
"dev:incremental": "node test",
305305
"doc": "doxygen doc/Doxyfile",
306-
"lint": "node scripts/clang-format.js",
306+
"lint": "node tools/clang-format.js",
307307
"lint:fix": "git-clang-format"
308308
},
309309
"pre-commit": "lint",

tools/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Migration Script
1+
# Tools
2+
3+
## clang-format
4+
5+
The clang-format checking tools is designed to check changed lines of code compared to given git-refs.
6+
7+
## Migration Script
28

39
The migration tool is designed to reduce repetitive work in the migration process. However, the script is not aiming to convert every thing for you. There are usually some small fixes and major reconstruction required.
410

scripts/clang-format.js renamed to tools/clang-format.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function main(args) {
2727
}
2828

2929
const clangFormatOutput = result.stdout.trim();
30-
if (clangFormatOutput !== ('no modified files to format') &&
30+
if (clangFormatOutput !== '' &&
31+
clangFormatOutput !== ('no modified files to format') &&
3132
clangFormatOutput !== ('clang-format did not modify any files')) {
3233
console.error(clangFormatOutput);
3334
const fixCmd = '"npm run lint:fix"';

0 commit comments

Comments
 (0)