Skip to content

Commit bbec92f

Browse files
committed
Reformat code after clang-format update (#850)
1 parent a168c9e commit bbec92f

File tree

115 files changed

+865
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+865
-771
lines changed

build/build.js

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ gulp.task('build:cross', ['backend:prod:cross', 'build-frontend:cross']);
4343
/**
4444
* Builds production version of the frontend application for the default architecture.
4545
*/
46-
gulp.task('build-frontend', ['localize', 'locales-for-backend'],
47-
function() { return doRevision(); });
46+
gulp.task(
47+
'build-frontend', ['localize', 'locales-for-backend'], function() { return doRevision(); });
4848

4949
/**
5050
* Builds production version of the frontend application for all supported architectures.
5151
*/
52-
gulp.task('build-frontend:cross', ['localize:cross', 'locales-for-backend:cross'],
53-
function() { return doRevision(); });
52+
gulp.task('build-frontend:cross', ['localize:cross', 'locales-for-backend:cross'], function() {
53+
return doRevision();
54+
});
5455

5556
/**
5657
* Localizes all pre-created frontend copies for the default arch, so that they are ready to serve.
@@ -71,15 +72,17 @@ gulp.task('localize:cross', ['frontend-copies:cross'], function() {
7172
* Copies the locales configuration to the default arch directory.
7273
* This configuration file is then used by the backend to localize dashboard.
7374
*/
74-
gulp.task('locales-for-backend', ['clean-dist'],
75-
function() { return localesForBackend([conf.paths.dist]); });
75+
gulp.task('locales-for-backend', ['clean-dist'], function() {
76+
return localesForBackend([conf.paths.dist]);
77+
});
7678

7779
/**
7880
* Copies the locales configuration to each arch directory.
7981
* This configuration file is then used by the backend to localize dashboard.
8082
*/
81-
gulp.task('locales-for-backend:cross', ['clean-dist'],
82-
function() { return localesForBackend(conf.paths.distCross); });
83+
gulp.task('locales-for-backend:cross', ['clean-dist'], function() {
84+
return localesForBackend(conf.paths.distCross);
85+
});
8386

8487
/**
8588
* Builds production version of the frontend application for the default architecture
@@ -95,19 +98,20 @@ gulp.task(
9598
* Builds production versions of the frontend application for all architecures
9699
* (one copy per locale) and places them under .tmp, preparing them for localization and revision.
97100
*/
98-
gulp.task('frontend-copies:cross',
99-
[
100-
'fonts:cross',
101-
'icons:cross',
102-
'assets:cross',
103-
'dependency-images:cross',
104-
'index:prod',
105-
'clean-dist',
106-
],
107-
function() {
108-
return createFrontendCopies(
109-
conf.arch.list.map((arch) => path.join(conf.paths.distPre, arch, 'public')));
110-
});
101+
gulp.task(
102+
'frontend-copies:cross',
103+
[
104+
'fonts:cross',
105+
'icons:cross',
106+
'assets:cross',
107+
'dependency-images:cross',
108+
'index:prod',
109+
'clean-dist',
110+
],
111+
function() {
112+
return createFrontendCopies(
113+
conf.arch.list.map((arch) => path.join(conf.paths.distPre, arch, 'public')));
114+
});
111115

112116
/**
113117
* Copies assets to the dist directory for current architecture.
@@ -117,8 +121,8 @@ gulp.task('assets', ['clean-dist'], function() { return assets([conf.paths.distP
117121
/**
118122
* Copies assets to the dist directory for all architectures.
119123
*/
120-
gulp.task('assets:cross', ['clean-dist'],
121-
function() { return assets(conf.paths.distPublicCross); });
124+
gulp.task(
125+
'assets:cross', ['clean-dist'], function() { return assets(conf.paths.distPublicCross); });
122126

123127
/**
124128
* Copies icons to the dist directory for current architecture.
@@ -143,14 +147,16 @@ gulp.task('fonts:cross', ['clean-dist'], function() { return fonts(conf.paths.di
143147
/**
144148
* Copies images from dependencies to the dist directory for current architecture.
145149
*/
146-
gulp.task('dependency-images', ['clean-dist'],
147-
function() { return dependencyImages([conf.paths.distPublic]); });
150+
gulp.task('dependency-images', ['clean-dist'], function() {
151+
return dependencyImages([conf.paths.distPublic]);
152+
});
148153

149154
/**
150155
* Copies images from dependencies to the dist directory for all architectures.
151156
*/
152-
gulp.task('dependency-images:cross', ['clean-dist'],
153-
function() { return dependencyImages(conf.paths.distPublicCross); });
157+
gulp.task('dependency-images:cross', ['clean-dist'], function() {
158+
return dependencyImages(conf.paths.distPublicCross);
159+
});
154160

155161
/**
156162
* Cleans all build artifacts.
@@ -270,8 +276,10 @@ function assets(outputDirs) {
270276
*/
271277
function icons(outputDirs) {
272278
let localizedOutputDirs = createLocalizedOutputs(outputDirs, 'static');
273-
return gulp.src(path.join(conf.paths.materialIcons, '/**/*.+(woff2|woff|eot|ttf)'),
274-
{base: conf.paths.materialIcons})
279+
return gulp
280+
.src(
281+
path.join(conf.paths.materialIcons, '/**/*.+(woff2|woff|eot|ttf)'),
282+
{base: conf.paths.materialIcons})
275283
.pipe(multiDest(localizedOutputDirs));
276284
}
277285

@@ -282,8 +290,8 @@ function icons(outputDirs) {
282290
*/
283291
function fonts(outputDirs) {
284292
let localizedOutputDirs = createLocalizedOutputs(outputDirs, 'fonts');
285-
return gulp.src(path.join(conf.paths.robotoFonts, '/**/*.+(woff2)'),
286-
{base: conf.paths.robotoFonts})
293+
return gulp
294+
.src(path.join(conf.paths.robotoFonts, '/**/*.+(woff2)'), {base: conf.paths.robotoFonts})
287295
.pipe(multiDest(localizedOutputDirs));
288296
}
289297

@@ -294,8 +302,8 @@ function fonts(outputDirs) {
294302
*/
295303
function dependencyImages(outputDirs) {
296304
let localizedOutputDirs = createLocalizedOutputs(outputDirs, 'static/img');
297-
return gulp.src(path.join(conf.paths.jsoneditorImages, '*.png'),
298-
{base: conf.paths.jsoneditorImages})
305+
return gulp
306+
.src(path.join(conf.paths.jsoneditorImages, '*.png'), {base: conf.paths.jsoneditorImages})
299307
.pipe(multiDest(localizedOutputDirs));
300308
}
301309

build/check.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ gulp.task('lint', ['lint-javascript', 'check-javascript-format', 'lint-styles'])
5151
* build scripts.
5252
*/
5353
gulp.task('lint-javascript', function() {
54-
return gulp.src([path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')])
54+
return gulp
55+
.src([path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')])
5556
// Attach lint output to the eslint property of the file.
5657
.pipe(gulpEslint())
5758
// Output the lint results to the console.
@@ -82,8 +83,10 @@ gulp.task('check-javascript-format', function() {
8283
* Formats all project's JavaScript files using clang-format.
8384
*/
8485
gulp.task('format-javascript', function() {
85-
return gulp.src([path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')],
86-
{base: conf.paths.base})
86+
return gulp
87+
.src(
88+
[path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')],
89+
{base: conf.paths.base})
8790
.pipe(gulpClangFormat.format('file'))
8891
.pipe(gulp.dest(conf.paths.base));
8992
});

build/conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export default {
156156
* Whether to use sauce labs for running tests that require a browser.
157157
*/
158158
useSauceLabs: !!process.env.SAUCE_USERNAME && !!process.env.SAUCE_ACCESS_KEY &&
159-
!!process.env.TRAVIS && process.env.TRAVIS_PULL_REQUEST === 'false',
159+
!!process.env.TRAVIS && process.env.TRAVIS_PULL_REQUEST === 'false',
160160
},
161161

162162
/**

build/deploy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@ gulp.task('docker-image:release:cross', ['build:cross', 'docker-file:cross'], fu
7676
/**
7777
* Pushes cross-compiled canary images to GCR.
7878
*/
79-
gulp.task('push-to-gcr:canary', ['docker-image:canary:cross'],
80-
function(doneFn) { pushToGcr(conf.deploy.versionCanary, doneFn); });
79+
gulp.task('push-to-gcr:canary', ['docker-image:canary:cross'], function(doneFn) {
80+
pushToGcr(conf.deploy.versionCanary, doneFn);
81+
});
8182

8283
/**
8384
* Pushes cross-compiled release images to GCR.
8485
*/
85-
gulp.task('push-to-gcr:release', ['docker-image:release:cross'],
86-
function(doneFn) { pushToGcr(conf.deploy.versionRelease, doneFn); });
86+
gulp.task('push-to-gcr:release', ['docker-image:release:cross'], function(doneFn) {
87+
pushToGcr(conf.deploy.versionRelease, doneFn);
88+
});
8789

8890
/**
8991
* Processes the Docker file and places it in the dist folder for building.

build/gocommand.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ function checkPrerequisites() {
6767
*/
6868
function checkGo() {
6969
let deferred = q.defer();
70-
child.exec('which go',
71-
{
72-
env: env,
73-
},
74-
function(error, stdout, stderror) {
75-
if (error || stderror || !stdout) {
76-
deferred.reject(new Error(
77-
'Go is not on the path. Please pass the PATH variable when you run ' +
78-
'the gulp task with "PATH=$PATH" or install go if you have not yet.'));
79-
return;
80-
}
81-
deferred.resolve();
82-
});
70+
child.exec(
71+
'which go', {
72+
env: env,
73+
},
74+
function(error, stdout, stderror) {
75+
if (error || stderror || !stdout) {
76+
deferred.reject(new Error(
77+
'Go is not on the path. Please pass the PATH variable when you run ' +
78+
'the gulp task with "PATH=$PATH" or install go if you have not yet.'));
79+
return;
80+
}
81+
deferred.resolve();
82+
});
8383
return deferred.promise;
8484
}
8585

@@ -90,8 +90,7 @@ function checkGo() {
9090
function checkGoVersion() {
9191
let deferred = q.defer();
9292
child.exec(
93-
'go version',
94-
{
93+
'go version', {
9594
env: env,
9695
},
9796
function(error, stdout) {
@@ -106,9 +105,10 @@ function checkGoVersion() {
106105
currentGoVersion = `${currentGoVersion}.0`;
107106
}
108107
if (semver.lt(currentGoVersion, minGoVersion)) {
109-
deferred.reject(new Error(`The current go version '${currentGoVersion}' is older than ` +
110-
`the minimum required version '${minGoVersion}'. ` +
111-
`Please upgrade your go version!`));
108+
deferred.reject(new Error(
109+
`The current go version '${currentGoVersion}' is older than ` +
110+
`the minimum required version '${minGoVersion}'. ` +
111+
`Please upgrade your go version!`));
112112
return;
113113
}
114114
deferred.resolve();
@@ -123,19 +123,19 @@ function checkGoVersion() {
123123
*/
124124
function checkGodep() {
125125
let deferred = q.defer();
126-
child.exec('which godep',
127-
{
128-
env: env,
129-
},
130-
function(error, stdout, stderror) {
131-
if (error || stderror || !stdout) {
132-
deferred.reject(
133-
new Error('Godep is not on the path. ' +
134-
'Please run "npm install" in the base directory of the project.'));
135-
return;
136-
}
137-
deferred.resolve();
138-
});
126+
child.exec(
127+
'which godep', {
128+
env: env,
129+
},
130+
function(error, stdout, stderror) {
131+
if (error || stderror || !stdout) {
132+
deferred.reject(new Error(
133+
'Godep is not on the path. ' +
134+
'Please run "npm install" in the base directory of the project.'));
135+
return;
136+
}
137+
deferred.resolve();
138+
});
139139
return deferred.promise;
140140
}
141141

build/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function extractForLanguage(langKey) {
3636
let translationBundle = path.join(conf.paths.base, `i18n/messages-${langKey}.xtb`);
3737
let codeSource = path.join(conf.paths.serve, '*.js');
3838
let command = `java -jar ${conf.paths.xtbgenerator} --lang ${langKey}` +
39-
` --xtb_output_file ${translationBundle} --js ${codeSource}`;
39+
` --xtb_output_file ${translationBundle} --js ${codeSource}`;
4040
if (fileExists(translationBundle)) {
4141
command = `${command} --translations_file ${translationBundle}`;
4242
}

build/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ gulp.task('index', ['scripts', 'styles'], function() {
6868
/**
6969
* Creates frontend application index file with production dependencies injected.
7070
*/
71-
gulp.task('index:prod', ['scripts:prod', 'styles:prod'],
72-
function() { return createIndexFile(conf.paths.prodTmp, false); });
71+
gulp.task('index:prod', ['scripts:prod', 'styles:prod'], function() {
72+
return createIndexFile(conf.paths.prodTmp, false);
73+
});

build/karma.conf.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,18 @@ function getFileList() {
3535
devDependencies: true,
3636
};
3737

38-
return wiredep(wiredepOptions)
39-
.js.concat([
40-
path.join(conf.paths.frontendTest, '**/*.json'),
41-
path.join(conf.paths.frontendTest, '**/*.js'),
42-
path.join(conf.paths.frontendSrc, '**/*.js'),
43-
path.join(conf.paths.frontendSrc, '**/*.html'),
44-
path.join(conf.paths.bowerComponents, 'google-closure-library/closure/goog/base.js'),
45-
{
46-
pattern:
47-
path.join(conf.paths.bowerComponents, 'google-closure-library/closure/goog/deps.js'),
48-
included: false,
49-
served: false,
50-
},
51-
]);
38+
return wiredep(wiredepOptions).js.concat([
39+
path.join(conf.paths.frontendTest, '**/*.json'),
40+
path.join(conf.paths.frontendTest, '**/*.js'),
41+
path.join(conf.paths.frontendSrc, '**/*.js'),
42+
path.join(conf.paths.frontendSrc, '**/*.html'),
43+
path.join(conf.paths.bowerComponents, 'google-closure-library/closure/goog/base.js'),
44+
{
45+
pattern: path.join(conf.paths.bowerComponents, 'google-closure-library/closure/goog/deps.js'),
46+
included: false,
47+
served: false,
48+
},
49+
]);
5250
}
5351

5452
/**
@@ -126,21 +124,20 @@ module.exports = function(config) {
126124
let testName;
127125
if (process.env.TRAVIS) {
128126
testName = `Karma tests ${process.env.TRAVIS_REPO_SLUG}, build ` +
129-
`${process.env.TRAVIS_BUILD_NUMBER}`;
127+
`${process.env.TRAVIS_BUILD_NUMBER}`;
130128
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
131129
testName += `, PR: https://github.com/${process.env.TRAVIS_REPO_SLUG}/pull/` +
132-
`${process.env.TRAVIS_PULL_REQUEST}`;
130+
`${process.env.TRAVIS_PULL_REQUEST}`;
133131
}
134132
} else {
135133
testName = 'Local karma tests';
136134
}
137135

138-
configuration.sauceLabs =
139-
{
140-
testName: testName,
141-
connectOptions: {port: 5757, logfile: 'sauce_connect.log'},
142-
public: 'public',
143-
},
136+
configuration.sauceLabs = {
137+
testName: testName,
138+
connectOptions: {port: 5757, logfile: 'sauce_connect.log'},
139+
public: 'public',
140+
},
144141
configuration.customLaunchers = {
145142
sl_chrome: {base: 'SauceLabs', browserName: 'chrome'},
146143
sl_firefox: {base: 'SauceLabs', browserName: 'firefox'},
@@ -162,8 +159,8 @@ module.exports = function(config) {
162159
['browserify', 'closure', 'closure-iit'];
163160
configuration.preprocessors[path.join(conf.paths.frontendSrc, '**/*.js')] =
164161
['browserify', 'closure'];
165-
configuration.preprocessors[path.join(conf.paths.bowerComponents,
166-
'google-closure-library/closure/goog/deps.js')] =
162+
configuration.preprocessors[path.join(
163+
conf.paths.bowerComponents, 'google-closure-library/closure/goog/deps.js')] =
167164
['closure-deps'];
168165

169166
// Convert HTML templates into JS files that serve code through $templateCache.

build/protractor.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ function createConfig() {
3838

3939
if (conf.test.useSauceLabs) {
4040
let name = `Integration tests ${process.env.TRAVIS_REPO_SLUG}, build ` +
41-
`${process.env.TRAVIS_BUILD_NUMBER}`;
41+
`${process.env.TRAVIS_BUILD_NUMBER}`;
4242
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
4343
name += `, PR: https://github.com/${process.env.TRAVIS_REPO_SLUG}/pull/` +
44-
`${process.env.TRAVIS_PULL_REQUEST}`;
44+
`${process.env.TRAVIS_PULL_REQUEST}`;
4545
}
4646

4747
config.sauceUser = process.env.SAUCE_USERNAME;

0 commit comments

Comments
 (0)