Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: git-clang-format doesn't recognize no changes requested on given files #835

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
"predev:incremental": "node-gyp configure build -C test --debug",
"dev:incremental": "node test",
"doc": "doxygen doc/Doxyfile",
"lint": "node scripts/clang-format.js",
"lint": "node tools/clang-format.js",
"lint:fix": "git-clang-format"
},
"pre-commit": "lint",
Expand Down
8 changes: 7 additions & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Migration Script
# Tools

## clang-format

The clang-format checking tools is designed to check changed lines of code compared to given git-refs.

## Migration Script

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.

Expand Down
3 changes: 2 additions & 1 deletion scripts/clang-format.js → tools/clang-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function main(args) {
}

const clangFormatOutput = result.stdout.trim();
if (clangFormatOutput !== ('no modified files to format') &&
if (clangFormatOutput !== '' &&
clangFormatOutput !== ('no modified files to format') &&
clangFormatOutput !== ('clang-format did not modify any files')) {
console.error(clangFormatOutput);
const fixCmd = '"npm run lint:fix"';
Expand Down