chore: adds a check for properly formatted files (#5624)

* chore: add check for clang format

* chore: updates clang format script
This commit is contained in:
alschmiedt
2021-10-25 11:43:59 -07:00
committed by GitHub
parent 52c0427d85
commit 8a89e080fd
5 changed files with 1014 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ var fs = require('fs');
var execSync = require('child_process').execSync;
var through2 = require('through2');
const clangFormatter = require('gulp-clang-format');
var closureCompiler = require('google-closure-compiler').gulp();
var closureDeps = require('google-closure-deps');
var argv = require('yargs').argv;
@@ -510,6 +511,15 @@ function cleanBuildDir(done) {
rimraf(BUILD_DIR, done);
}
/**
* Runs clang format on all files in the core directory.
*/
function format() {
return gulp.src(['core/**/*.js'], {base: '.'})
.pipe(clangFormatter.format('file'))
.pipe(gulp.dest('.'));
};
module.exports = {
build: build,
deps: buildDeps,
@@ -518,6 +528,7 @@ module.exports = {
generateLangfiles: generateLangfiles,
langfiles: buildLangfiles,
compressed: buildCompressed,
format: format,
generators: buildGenerators,
checkinBuilt: checkinBuilt,
cleanBuildDir: cleanBuildDir,