gulp-format
v1.0.8
Published
Gulp plugin to format code as properly formatted, according to clang-format.
Downloads
588
Readme
gulp-format
Gulp plugin to format code as properly formatted, according to clang-format.
Usage
Sample gulpfile.js:
var format = require('gulp-format');
gulp.task('check-format', function() {
return gulp.src('*.js')
.pipe(format.check());
});
gulp.task('format',function(){
return gulp.src('*.js')
.pipe(format());
});
Options
The check() function accepts an optional parameter indicating the style to use. By default, it applies the "Google" style.
The parameter is passed to the -style argument of clang-format. See the docs here: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
The recommended value is the string 'file', this means that clang-format will look for a .clang-format file in your repository. This allows you to keep the formatting consistent with other developers.