build: update to clang 1.4.0 and only run clang format on changed files (#36203)

Update to clang@1.4.0 to gain support for optional changing and nullish
coalescing.  Because this would trigger a change on >1800 files in the
repository, also changes our format enforcement to only be run against
changed files.  This will allow us to incramentally roll out the value
add of the upgraded clang format.

PR Close #36203
This commit is contained in:
Joey Perrott
2020-03-23 08:53:42 -07:00
committed by Alex Rickabaugh
parent 51a89c32c4
commit c5c57f6737
6 changed files with 60 additions and 41 deletions

View File

@ -26,26 +26,30 @@ function loadTask(fileName, taskName) {
return task(gulp);
}
// Check source code for formatting errors in all source files.
gulp.task('format:enforce', loadTask('format', 'enforce'));
//#######################################################
// A format and enforce task for different sets of files.
//#######################################################
// Format all source files.
// All source files.
gulp.task('format:all', loadTask('format', 'format'));
gulp.task('format:all:enforce', loadTask('format', 'enforce'));
// Format only untracked source code files.
// Untracked source code files.
gulp.task('format:untracked', loadTask('format', 'format-untracked'));
gulp.task('format:untracked:enforce', loadTask('format', 'enforce-untracked'));
// Format only the changed, tracked source code files.
// Changed, tracked source code files.
gulp.task('format:diff', loadTask('format', 'format-diff'));
gulp.task('format:diff:enforce', loadTask('format', 'enforce-diff'));
// Format only changed lines based on the diff from the provided --branch
// argument (or `master` by default).
// Changed, both tracked and untracked, source code files.
gulp.task('format:changed', ['format:untracked', 'format:diff']);
gulp.task('format:changed:enforce', ['format:untracked:enforce', 'format:diff:enforce']);
// Alias for `format:changed` that formerly formatted all files.
gulp.task('format', ['format:changed']);
gulp.task('lint', ['format:enforce', 'validate-commit-messages']);
gulp.task('lint', ['format:changed:enforce', 'validate-commit-messages']);
gulp.task('validate-commit-messages', loadTask('validate-commit-message'));
gulp.task('source-map-test', loadTask('source-map-test'));
gulp.task('changelog', loadTask('changelog'));