Skip to content

Commit eb4abfc

Browse files
committed
remove spaces before '(' to follow style guide
1 parent ed69aeb commit eb4abfc

28 files changed

+171
-171
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var paths = {
3232
images: 'client/img/**/*'
3333
};
3434

35-
gulp.task('scripts', function () {
35+
gulp.task('scripts', function() {
3636
// Minify and copy all JavaScript (except vendor scripts)
3737
return gulp.src(paths.scripts)
3838
.pipe(coffee())
@@ -42,15 +42,15 @@ gulp.task('scripts', function () {
4242
});
4343

4444
// Copy all static images
45-
gulp.task('images', function () {
45+
gulp.task('images', function() {
4646
return gulp.src(paths.images)
4747
// Pass in options to the task
4848
.pipe(imagemin({optimizationLevel: 5}))
4949
.pipe(gulp.dest('build/img'));
5050
});
5151

5252
// Rerun the task when a file changes
53-
gulp.task('watch', function () {
53+
gulp.task('watch', function() {
5454
gulp.watch(paths.scripts, ['scripts']);
5555
gulp.watch(paths.images, ['images']);
5656
});

bin/gulp.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ var cli = new Liftoff({
1414
completions: require('../lib/completion')
1515
});
1616

17-
cli.on('require', function (name) {
17+
cli.on('require', function(name) {
1818
gutil.log('Requiring external module', chalk.magenta(name));
1919
});
2020

21-
cli.on('requireFail', function (name) {
21+
cli.on('requireFail', function(name) {
2222
gutil.log(chalk.red('Failed to load external module'), chalk.magenta(name));
2323
});
2424

@@ -70,7 +70,7 @@ function handleArguments(env) {
7070
gutil.log('Working directory changed to', chalk.magenta(env.cwd));
7171
}
7272

73-
process.nextTick(function () {
73+
process.nextTick(function() {
7474
if (tasksFlag) {
7575
return logTasks(gulpFile, gulpInst);
7676
}
@@ -81,7 +81,7 @@ function handleArguments(env) {
8181
function logTasks(gulpFile, localGulp) {
8282
var tree = taskTree(localGulp.tasks);
8383
tree.label = 'Tasks for ' + chalk.magenta(gulpFile);
84-
archy(tree).split('\n').forEach(function (v) {
84+
archy(tree).split('\n').forEach(function(v) {
8585
if (v.trim().length === 0) return;
8686
gutil.log(v);
8787
});
@@ -96,22 +96,22 @@ function formatError(e) {
9696

9797
// wire up logging events
9898
function logEvents(gulpInst) {
99-
gulpInst.on('task_start', function (e) {
99+
gulpInst.on('task_start', function(e) {
100100
gutil.log('Starting', "'" + chalk.cyan(e.task) + "'...");
101101
});
102102

103-
gulpInst.on('task_stop', function (e) {
103+
gulpInst.on('task_stop', function(e) {
104104
var time = prettyTime(e.hrDuration);
105105
gutil.log('Finished', "'" + chalk.cyan(e.task) + "'", 'after', chalk.magenta(time));
106106
});
107107

108-
gulpInst.on('task_err', function (e) {
108+
gulpInst.on('task_err', function(e) {
109109
var msg = formatError(e);
110110
var time = prettyTime(e.hrDuration);
111111
gutil.log("'" + chalk.cyan(e.task) + "'", 'errored after', chalk.magenta(time), chalk.red(msg));
112112
});
113113

114-
gulpInst.on('task_not_found', function (err) {
114+
gulpInst.on('task_not_found', function(err) {
115115
gutil.log(chalk.red("Task '" + err.task + "' was not defined in your gulpfile but you tried to run it."));
116116
gutil.log('Please check the documentation for proper gulpfile formatting.');
117117
process.exit(1);

docs/API.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The path (folder) to write files to.
5959
Define a task using [Orchestrator].
6060

6161
```javascript
62-
gulp.task('somename', function () {
62+
gulp.task('somename', function() {
6363
// Do stuff
6464
});
6565
```
@@ -74,7 +74,7 @@ Type: `Array`
7474
An array of tasks to be executed and completed before your task will run.
7575

7676
```javascript
77-
gulp.task('mytask', ['array', 'of', 'task', 'names'], function () {
77+
gulp.task('mytask', ['array', 'of', 'task', 'names'], function() {
7878
// Do stuff
7979
});
8080
```
@@ -93,7 +93,7 @@ Tasks can be made asynchronous if its `fn` does one of the following:
9393
##### Accept a callback
9494

9595
```javascript
96-
gulp.task('somename', function (cb) {
96+
gulp.task('somename', function(cb) {
9797
// Do stuff
9898
cb(err);
9999
});
@@ -102,7 +102,7 @@ gulp.task('somename', function (cb) {
102102
##### Return a stream
103103

104104
```javascript
105-
gulp.task('somename', function () {
105+
gulp.task('somename', function() {
106106
var stream = gulp.src('./client/**/*.js')
107107
.pipe(minify())
108108
.pipe(gulp.dest('/build'));
@@ -115,11 +115,11 @@ gulp.task('somename', function () {
115115
```javascript
116116
var Q = require('q');
117117

118-
gulp.task('somename', function () {
118+
gulp.task('somename', function() {
119119
var deferred = Q.defer();
120120

121121
// Do async stuff
122-
setTimeout(function () {
122+
setTimeout(function() {
123123
deferred.resolve();
124124
}, 1);
125125

@@ -146,13 +146,13 @@ So this example would look like this:
146146
var gulp = require('gulp');
147147

148148
// takes in a callback so the engine knows when it'll be done
149-
gulp.task('one', function (cb) {
149+
gulp.task('one', function(cb) {
150150
// do stuff -- async or otherwise
151151
cb(err); // if err is not null and not undefined, the run will stop, and note that it failed
152152
});
153153

154154
// identifies a dependent task must be complete before this one begins
155-
gulp.task('two', ['one'], function () {
155+
gulp.task('two', ['one'], function() {
156156
// task 'one' is done now
157157
});
158158

@@ -183,7 +183,7 @@ Names of task(s) to run when a file changes, added with `gulp.task()`
183183

184184
```javascript
185185
var watcher = gulp.watch('js/**/*.js', ['uglify','reload']);
186-
watcher.on('change', function (event) {
186+
watcher.on('change', function(event) {
187187
console.log('File '+event.path+' was '+event.type+', running tasks...');
188188
});
189189
```
@@ -206,7 +206,7 @@ Type: `Function`
206206
Callback to be called on each change.
207207

208208
```javascript
209-
gulp.watch('js/**/*.js', function (event) {
209+
gulp.watch('js/**/*.js', function(event) {
210210
console.log('File '+event.path+' was '+event.type+', running tasks...');
211211
});
212212
```

docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm install --save-dev gulp
1717
```javascript
1818
var gulp = require('gulp');
1919

20-
gulp.task('default', function () {
20+
gulp.task('default', function() {
2121
// place code for your default task here
2222
});
2323
```

docs/recipes/combining-streams-to-handle-errors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var Combine = require('stream-combiner');
1414
var uglify = require('gulp-uglify');
1515
var gulp = require('gulp');
1616

17-
gulp.task('test', function () {
17+
gulp.task('test', function() {
1818
var combined = Combine(
1919
gulp.src('bootstrap/js/*.js'),
2020
uglify(),
@@ -24,7 +24,7 @@ gulp.task('test', function () {
2424
// any errors in the above streams
2525
// will get caught by this listener,
2626
// instead of being thrown:
27-
combined.on('error', function (err) {
27+
combined.on('error', function(err) {
2828
console.warn(err.message)
2929
});
3030

docs/recipes/fast-browserify-builds-with-watchify.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var gulp = require('gulp')
2020
var source = require('vinyl-source-stream')
2121
var watchify = require('watchify')
2222

23-
gulp.task('watch', function () {
23+
gulp.task('watch', function() {
2424
var bundler = watchify('./src/index.js');
2525

2626
// Optionally, you can apply transforms

docs/recipes/mocha-test-runner-with-gulp.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var gulp = require('gulp');
77
var mocha = require('gulp-mocha');
88

9-
gulp.task('tests', function () {
9+
gulp.task('tests', function() {
1010
return gulp.src(['test/test-*.js'], { read: false })
1111
.pipe(mocha({
1212
reporter: 'spec',
@@ -29,13 +29,13 @@ var mocha = require('gulp-mocha');
2929
var batch = require('gulp-batch');
3030
var gutil = require('gulp-util');
3131

32-
gulp.task('mocha', function () {
32+
gulp.task('mocha', function() {
3333
return gulp.src(['test/*.js'], { read: false })
3434
.pipe(mocha({ reporter: 'list' }))
3535
.on('error', gutil.log);
3636
});
3737

38-
gulp.watch(['lib/**', 'test/**'], batch(function (events, cb) {
38+
gulp.watch(['lib/**', 'test/**'], batch(function(events, cb) {
3939
gulp.run('mocha', cb);
4040
}));
4141
```
@@ -50,15 +50,15 @@ var mocha = require('gulp-mocha');
5050
var watch = require('gulp-watch');
5151
var gutil = require('gulp-util')
5252

53-
gulp.task('mocha', function () {
53+
gulp.task('mocha', function() {
5454
return gulp.src(['test/*.js'], { read: false })
5555
.pipe(mocha({ reporter: 'list' }))
5656
.on('error', gutil.log);
5757
});
5858

59-
gulp.task('watch', function () {
59+
gulp.task('watch', function() {
6060
return gulp.src(['lib/**', 'test/**'], { read: false })
61-
.pipe(watch(function (events, cb) {
61+
.pipe(watch(function(events, cb) {
6262
gulp.run('mocha', cb);
6363
}));
6464
});

docs/recipes/only-pass-through-changed-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var uglify = require('gulp-uglify');
1414
var SRC = 'src/*.js';
1515
var DEST = 'dist';
1616

17-
gulp.task('default', function () {
17+
gulp.task('default', function() {
1818
return gulp.src(SRC)
1919
// the `changed` task needs to know the destination directory
2020
// upfront to be able to figure out which files changed

docs/recipes/pass-params-from-cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var uglify = require('gulp-uglify');
1414

1515
var isProduction = args.type === 'production';
1616

17-
gulp.task('scripts', function () {
17+
gulp.task('scripts', function() {
1818
return gulp.src('**/*.js')
1919
.pipe(gulpif(isProduction, uglify())) // only minify if production
2020
.pipe(gulp.dest('dist'));

docs/recipes/rebuild-only-files-that-change.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var gulp = require('gulp');
77
var sass = require('gulp-sass');
88
var watch = require('gulp-watch');
99

10-
gulp.task('default', function () {
10+
gulp.task('default', function() {
1111
return gulp.src('./sass/*.scss')
1212
.pipe(watch())
1313
.pipe(sass())

docs/recipes/running-task-steps-per-folder.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ var scriptsPath = './src/scripts/';
2727

2828
function getFolders(dir) {
2929
return fs.readdirSync(dir)
30-
.filter(function (file) {
30+
.filter(function(file) {
3131
return fs.statSync(path.join(dir, file)).isDirectory();
3232
});
3333
}
3434

35-
gulp.task('scripts', function () {
35+
gulp.task('scripts', function() {
3636
var folders = getFolders(scriptsPath);
3737

38-
var tasks = folders.map(function (folder) {
38+
var tasks = folders.map(function(folder) {
3939
// concat into foldername.js
4040
// write to output
4141
// minify

docs/recipes/running-tasks-in-series.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ So this example would look like this:
1919
var gulp = require('gulp');
2020

2121
// takes in a callback so the engine knows when it'll be done
22-
gulp.task('one', function (cb) {
22+
gulp.task('one', function(cb) {
2323
// do stuff -- async or otherwise
2424
cb(err); // if err is not null and not undefined, the orchestration will stop, and 'two' will not run
2525
});
2626

2727
// identifies a dependent task must be complete before this one begins
28-
gulp.task('two', ['one'], function () {
28+
gulp.task('two', ['one'], function() {
2929
// task 'one' is done now
3030
});
3131

docs/recipes/sharing-streams-with-stream-factories.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ var coffee = require('gulp-coffee');
1616
var jshint = require('gulp-jshint');
1717
var stylish = require('jshint-stylish');
1818

19-
gulp.task('bootstrap', function () {
19+
gulp.task('bootstrap', function() {
2020
return gulp.src('bootstrap/js/*.js')
2121
.pipe(jshint())
2222
.pipe(jshint.reporter(stylish))
2323
.pipe(uglify())
2424
.pipe(gulp.dest('public/bootstrap'));
2525
});
2626

27-
gulp.task('coffee', function () {
27+
gulp.task('coffee', function() {
2828
return gulp.src('lib/js/*.coffee')
2929
.pipe(coffee())
3030
.pipe(jshint())
@@ -51,13 +51,13 @@ var jsTransform = lazypipe()
5151
.pipe(jshint.reporter, stylish)
5252
.pipe(uglify);
5353

54-
gulp.task('bootstrap', function () {
54+
gulp.task('bootstrap', function() {
5555
return gulp.src('bootstrap/js/*.js')
5656
.pipe(jsTransform())
5757
.pipe(gulp.dest('public/bootstrap'));
5858
});
5959

60-
gulp.task('coffee', function () {
60+
gulp.task('coffee', function() {
6161
return gulp.src('lib/js/*.coffee')
6262
.pipe(coffee())
6363
.pipe(jsTransform())

docs/recipes/using-external-config-file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function doStuff(cfg) {
4141
.pipe(gulp.dest(cfg.dest));
4242
}
4343

44-
gulp.task('dry', function () {
44+
gulp.task('dry', function() {
4545
doStuff(config.desktop);
4646
doStuff(config.mobile);
4747
});

docs/recipes/using-multiple-sources-in-one-task.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
var gulp = require('gulp');
77
var es = require('event-stream');
88

9-
gulp.task('test', function (cb) {
9+
gulp.task('test', function(cb) {
1010
return es.concat(
1111
gulp.src('bootstrap/js/*.js')
1212
.pipe(gulp.dest('public/bootstrap')),
@@ -25,7 +25,7 @@ var gulp = require('gulp');
2525
var concat = require('gulp-concat');
2626
var streamqueue = require('streamqueue');
2727

28-
gulp.task('default', function () {
28+
gulp.task('default', function() {
2929
return streamqueue({ objectMode: true },
3030
gulp.src('foo/*'),
3131
gulp.src('bar/*')
@@ -36,7 +36,7 @@ gulp.task('default', function () {
3636

3737
// ... or ...
3838

39-
gulp.task('default', function () {
39+
gulp.task('default', function() {
4040
var stream = streamqueue({ objectMode: true });
4141
stream.queue(gulp.src('foo/*'));
4242
stream.queue(gulp.src('bar/*'));

docs/writing-a-plugin/dealing-with-streams.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function prefixStream(prefixText) {
2424
return stream;
2525
}
2626

27-
// Plugin level function (dealing with files)
27+
// Plugin level function(dealing with files)
2828
function gulpPrefixer(prefixText) {
2929

3030
if (!prefixText) {
@@ -33,7 +33,7 @@ function gulpPrefixer(prefixText) {
3333
prefixText = new Buffer(prefixText); // allocate ahead of time
3434

3535
// Creating a stream through which each file will pass
36-
var stream = through.obj(function (file, enc, callback) {
36+
var stream = through.obj(function(file, enc, callback) {
3737
if (file.isNull()) {
3838
this.push(file); // Do nothing if no contents
3939
return callback();

0 commit comments

Comments
 (0)