Last active
April 16, 2017 20:29
-
-
Save alexeagle/87a769ff627a43c9fc6f498d49b2a577 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const format = require('gulp-clang-format'); | |
const clangFormat = require('clang-format'); | |
const srcsToFmt = ['{src,test}/*.{js,ts}', '*.js']; | |
gulp.task( | |
'format:enforce', | |
() => gulp.src(srcsToFmt).pipe( | |
format.checkFormat('file', clangFormat, {verbose: true, fail: true}))); | |
gulp.task( | |
'format', | |
() => gulp.src(srcsToFmt, {base: '.'}) | |
.pipe(format.format('file', clangFormat)) | |
.pipe(gulp.dest('.'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment