mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user