提交 b18fbdd1 编写于 作者: B bryk

Reformat code on new clang format release

上级 a5b3196b
......@@ -48,16 +48,15 @@ gulp.task('build-frontend', ['assets', 'index:prod', 'clean-dist'], function() {
let vendorCssFilter = gulpFilter('**/vendor.css', {restore: true});
let vendorJsFilter = gulpFilter('**/vendor.js', {restore: true});
let assetsFilter = gulpFilter(['**/*.js', '**/*.css'], {restore: true});
let searchPath = [
// To resolve local paths.
path.relative(conf.paths.base, conf.paths.prodTmp),
// To resolve bower_components/... paths.
path.relative(conf.paths.base, conf.paths.base),
];
return gulp.src(path.join(conf.paths.prodTmp, '*.html'))
.pipe(gulpUseref({
searchPath: [
// To resolve local paths.
path.relative(conf.paths.base, conf.paths.prodTmp),
// To resolve bower_components/... paths.
path.relative(conf.paths.base, conf.paths.base),
],
}))
.pipe(gulpUseref({searchPath: searchPath}))
.pipe(vendorCssFilter)
.pipe(gulpMinifyCss())
.pipe(vendorCssFilter.restore)
......@@ -67,7 +66,7 @@ gulp.task('build-frontend', ['assets', 'index:prod', 'clean-dist'], function() {
.pipe(assetsFilter)
.pipe(gulpRev())
.pipe(assetsFilter.restore)
.pipe(gulpUseref({searchPath: [conf.paths.prodTmp]}))
.pipe(gulpUseref({searchPath: searchPath}))
.pipe(gulpRevReplace())
.pipe(htmlFilter)
.pipe(gulpHtmlmin({
......
......@@ -51,7 +51,8 @@ gulp.task('lint', ['lint-javascript', 'check-javascript-format', 'lint-styles'])
* build scripts.
*/
gulp.task('lint-javascript', function() {
return gulp.src([path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')])
return gulp
.src([path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')])
// Attach lint output to the eslint property of the file.
.pipe(gulpEslint())
// Output the lint results to the console.
......@@ -82,9 +83,10 @@ gulp.task('check-javascript-format', function() {
* Formats all project's JavaScript files using clang-format.
*/
gulp.task('format-javascript', function() {
return gulp.src(
[path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')],
{base: conf.paths.base})
return gulp
.src(
[path.join(conf.paths.src, '**/*.js'), path.join(conf.paths.build, '**/*.js')],
{base: conf.paths.base})
.pipe(gulpClangFormat.format('file'))
.pipe(gulp.dest(conf.paths.base));
});
......@@ -68,8 +68,7 @@ function checkPrerequisites() {
function checkGo() {
let deferred = q.defer();
child.exec(
'which go',
{
'which go', {
env: env,
},
function(error, stdout, stderror) {
......@@ -92,8 +91,7 @@ function checkGo() {
function checkGoVersion() {
let deferred = q.defer();
child.exec(
'go version',
{
'go version', {
env: env,
},
function(error, stdout) {
......@@ -128,8 +126,7 @@ function checkGoVersion() {
function checkGodep() {
let deferred = q.defer();
child.exec(
'which godep',
{
'which godep', {
env: env,
},
function(error, stdout, stderror) {
......
......@@ -126,11 +126,8 @@ gulp.task('angular-templates', function() {
collapseWhitespace: true,
conservativeCollapse: true,
}))
.pipe(
gulpAngularTemplatecache(
'angular-templates.js',
{
module: conf.frontend.rootModuleName,
}))
.pipe(gulpAngularTemplatecache('angular-templates.js', {
module: conf.frontend.rootModuleName,
}))
.pipe(gulp.dest(conf.paths.partials));
});
......@@ -17,10 +17,11 @@ import chromeDirective from './chrome_directive';
/**
* Angular module containing navigation chrome for the application.
*/
export default angular.module(
'kubernetesDashboard.chrome',
[
'ngMaterial',
'ui.router',
])
export default angular
.module(
'kubernetesDashboard.chrome',
[
'ngMaterial',
'ui.router',
])
.directive('chrome', chromeDirective);
......@@ -17,9 +17,10 @@ import labelsDirective from './labels/labels_directive';
/**
* Module containing common components for the application.
*/
export default angular.module(
'kubernetesDashboard.common.components',
[
'ngMaterial',
])
export default angular
.module(
'kubernetesDashboard.common.components',
[
'ngMaterial',
])
.directive('kdLabels', labelsDirective);
......@@ -18,9 +18,10 @@ import errorDialogService from './errordialog_service';
/**
* Angular module containing navigation chrome for the application.
*/
export default angular.module(
'kubernetesDashboard.errorhandling',
[
'ngMaterial',
])
export default angular
.module(
'kubernetesDashboard.errorhandling',
[
'ngMaterial',
])
.service('errorDialog', errorDialogService);
......@@ -18,10 +18,11 @@ import relativeTimeFilter from './relativetime_filter';
/**
* Module containing common filters for the application.
*/
export default angular.module(
'kubernetesDashboard.common.filters',
[
'ngMaterial',
])
export default angular
.module(
'kubernetesDashboard.common.filters',
[
'ngMaterial',
])
.filter('middleEllipsis', middleEllipsisFilter)
.filter('relativeTime', relativeTimeFilter);
......@@ -29,15 +29,16 @@ import helpSectionModule from './helpsection/helpsection_module';
*
* The view allows for deploying applications to Kubernetes clusters.
*/
export default angular.module(
'kubernetesDashboard.deploy',
[
'ngMaterial',
'ngResource',
'ui.router',
helpSectionModule.name,
errorHandlingModule.name,
])
export default angular
.module(
'kubernetesDashboard.deploy',
[
'ngMaterial',
'ngResource',
'ui.router',
helpSectionModule.name,
errorHandlingModule.name,
])
.config(stateConfig)
.directive('deployFromSettings', deployFromSettingsDirective)
.directive('deployFromFile', deployFromFileDirective)
......
......@@ -221,7 +221,7 @@ export default class DeployFromSettingsController {
let name = this.form['name'];
return name.$error[uniqueNameValidationKey] ||
(name.$invalid && (name.$touched || this.form.$submitted));
(name.$invalid && (name.$touched || this.form.$submitted));
}
/**
......
......@@ -18,11 +18,12 @@ import stateConfig from './internalerror_stateconfig';
/**
* Angular module for error views.
*/
export default angular.module(
'kubernetesDashboard.error',
[
'ui.router',
])
export default angular
.module(
'kubernetesDashboard.error',
[
'ui.router',
])
.config(stateConfig)
.run(errorConfig);
......
......@@ -25,22 +25,23 @@ import logsModule from './logs/logs_module';
import replicaSetDetailModule from './replicasetdetail/replicasetdetail_module';
import replicaSetListModule from './replicasetlist/replicasetlist_module';
export default angular.module(
'kubernetesDashboard',
[
'ngAnimate',
'ngAria',
'ngMaterial',
'ngMessages',
'ngResource',
'ngSanitize',
'ui.router',
chromeModule.name,
deployModule.name,
errorModule.name,
logsModule.name,
replicaSetDetailModule.name,
replicaSetListModule.name,
])
export default angular
.module(
'kubernetesDashboard',
[
'ngAnimate',
'ngAria',
'ngMaterial',
'ngMessages',
'ngResource',
'ngSanitize',
'ui.router',
chromeModule.name,
deployModule.name,
errorModule.name,
logsModule.name,
replicaSetDetailModule.name,
replicaSetListModule.name,
])
.config(indexConfig)
.config(routeConfig);
......@@ -19,11 +19,12 @@ import {LogColorInversionService} from './logs_service';
* Angular module for the logs view.
*
*/
export default angular.module(
'kubernetesDashboard.logs',
[
'ngResource',
'ui.router',
])
export default angular
.module(
'kubernetesDashboard.logs',
[
'ngResource',
'ui.router',
])
.service('logsColorInversionService', LogColorInversionService)
.config(stateConfig);
......@@ -184,8 +184,8 @@ export default class ReplicaSetDetailController {
* @export
*/
handleDeleteReplicaSetDialog() {
this.kdReplicaSetService_.showDeleteDialog(
this.stateParams_.namespace, this.stateParams_.replicaSet)
this.kdReplicaSetService_
.showDeleteDialog(this.stateParams_.namespace, this.stateParams_.replicaSet)
.then(this.onReplicaSetDeleteSuccess_.bind(this), this.onReplicaSetDeleteError_.bind(this));
}
......
......@@ -25,16 +25,17 @@ import {ReplicaSetService} from './replicaset_service';
*
* The view shows detailed view of a Replica Sets.
*/
export default angular.module(
'kubernetesDashboard.replicaSetDetail',
[
'ngMaterial',
'ngResource',
'ui.router',
componentsModule.name,
filtersModule.name,
logsModule.name,
])
export default angular
.module(
'kubernetesDashboard.replicaSetDetail',
[
'ngMaterial',
'ngResource',
'ui.router',
componentsModule.name,
filtersModule.name,
logsModule.name,
])
.config(stateConfig)
.directive('kdServiceEndpoint', serviceEndpointDirective)
.directive('kdSortedHeader', sortedHeaderDirective)
......
......@@ -26,16 +26,17 @@ import replicaSetListContainer from './replicasetlistcontainer_directive';
*
* The view shows Replica Sets running in the cluster and allows to manage them.
*/
export default angular.module(
'kubernetesDashboard.replicaSetList',
[
'ngMaterial',
'ngResource',
'ui.router',
replicaSetDetailModule.name,
filtersModule.name,
componentsModule.name,
])
export default angular
.module(
'kubernetesDashboard.replicaSetList',
[
'ngMaterial',
'ngResource',
'ui.router',
replicaSetDetailModule.name,
filtersModule.name,
componentsModule.name,
])
.config(stateConfig)
.directive('logsMenu', logsMenuDirective)
.directive('kdReplicaSetListContainer', replicaSetListContainer)
......
......@@ -108,8 +108,9 @@ describe('Replica Set Detail controller', () => {
});
it('should create logs href', () => {
expect(ctrl.getPodLogsHref({name: 'foo-pod'}))
.toBe('#/logs/foo-namespace/foo-replicaset/foo-pod/');
expect(ctrl.getPodLogsHref({
name: 'foo-pod',
})).toBe('#/logs/foo-namespace/foo-replicaset/foo-pod/');
});
it('should show delete replicas dialog', () => {
......
......@@ -72,8 +72,8 @@ describe('Update Replicas controller', () => {
httpBackend.flush();
// then
expect(log.info)
.toHaveBeenCalledWith(`Successfully updated replicas number to ${replicaSpec.replicas}`);
expect(log.info).toHaveBeenCalledWith(
`Successfully updated replicas number to ${replicaSpec.replicas}`);
expect(state.reload).toHaveBeenCalled();
});
......
......@@ -47,8 +47,8 @@ describe('Replica set card menu controller', () => {
ctrl.viewDetails();
// then
expect(state.go)
.toHaveBeenCalledWith('replicasetdetail', new StateParams('foo-namespace', 'foo-name'));
expect(state.go).toHaveBeenCalledWith(
'replicasetdetail', new StateParams('foo-namespace', 'foo-name'));
});
it('should open the menu', () => {
......
......@@ -59,7 +59,7 @@ describe('Replica set list container', () => {
let actual = binarySearchOptimalHeight(heights, numColumns);
expect(actual).toBe(
expected, `Expected height to be ${expected} but was ${actual}. ` +
`Required number of columns: ${numColumns}, heights: [${heights}]`);
`Required number of columns: ${numColumns}, heights: [${heights}]`);
}
});
});
@import url(//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic);@import url(//fonts.googleapis.com/icon?family=Material+Icons);a,a:visited{color:#326de6}.kd-toolbar-logo{height:42px;margin-right:1em;width:42px}.kd-toolbar{box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12)}body{background-color:#eee;height:100%}a{text-decoration:inherit}.kd-app-content-wrapper,.kd-toolbar-tools{margin:0 auto}.kd-app-content{position:relative}.kd-center-fixed{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;right:0;top:0}.kd-text-icon{font-size:inherit;height:inherit;vertical-align:middle}.kd-comma-separated-item:after{content:','}.kd-comma-separated-item:last-child:after{content:''}.kd-deploy-whiteframe{background:#fff;margin:1em;max-width:960px;min-width:600px}md-progress-linear.kd-deploy-form-progress{clear:left;height:2px;margin-bottom:-2px;overflow:hidden;top:-2px}.kd-deploy-input-row{margin:0 0 8px}.kd-upload-button{padding-left:0;padding-right:0}.kd-upload-label{cursor:inherit;display:inline-block;width:100%}.kd-error-view-icon{color:rgba(0,0,0,.54);font-size:112px}.kd-logs-text-color-invert{background-color:#000;color:#fff}.kd-logs-text-color{background-color:#fff;color:#000}.kd-logs-element{padding:0;word-wrap:break-word}.kd-replicasetdetail-app-name{color:rgba(0,0,0,.54);font-weight:400}.kd-replicasetdetail-sidebar{background-color:#fafafa;max-width:395px;min-width:315px}.kd-replicasetdetail-sidebar-item{padding-left:16px;padding-right:8px}.kd-replicasetdetail-table{width:100%}.kd-replicasetdetail-sidebar-header{height:48px}.kd-replicasetdetail-sidebar-header-wrapper{border-bottom:1px solid rgba(0,0,0,.12)}.kd-replicasetdetail-sidebar-title{font-size:16px;font-weight:500;padding-bottom:8px;padding-top:8px}.kd-replicasetdetail-sidebar-title.kd-replicasetdetail-sidebar-info{padding-bottom:0;padding-top:16px}.kd-replicasetdetail-sidebar-line{color:rgba(0,0,0,.54);display:block;font-size:14px;padding-bottom:8px}.kd-replicasetdetail-sidebar-subline{color:rgba(0,0,0,.87);display:block;font-size:14px;overflow:hidden;padding-bottom:8px;text-overflow:ellipsis}.kd-replicasetdetail-sidebar-subline.kd-has-labels{margin-bottom:-4px}.kd-replicasetdetail-warning-icon{color:orange;font-size:24px;padding:0 8px;vertical-align:middle}.kd-replicasetdetail-options{margin:16px}.kd-replicasetdetail-sidebar-info{padding-left:14px}.kd-replicasetdetail-option-picker{padding-right:16px;width:120px}.kd-replicasetdetail-table-cell,.kd-replicasetdetail-table-header{border-bottom:1px solid rgba(0,0,0,.12);font-size:14px;height:48px;padding:0 0 0 16px}.kd-replicasetdetail-table-header{color:rgba(0,0,0,.54);font-weight:400;text-align:left;white-space:nowrap}.kd-replicasetdetail-table-cell.kd-replicasetdetail-message-table-cell{white-space:normal;word-break:break-all}.kd-replicasetdetail-table-icon{font-size:inherit;vertical-align:top}.kd-replicasetdetail-help-icon{color:rgba(0,0,0,.54);cursor:default}.kd-replicaset-detail-table-header-button{background:inherit;border:0;color:inherit;padding:0}.kd-replicaset-detail-table-header-button:focus{outline:0}.kd-updatereplicas-pod-status{font-size:14px}.kd-replicaset-card{margin:8px;width:416px}.kd-replicaset-card-name{color:inherit;display:inline-block;font-weight:400;text-decoration:none}.kd-replicaset-card-name:visited{color:inherit}.kd-menu-logs-item-header,.kd-replicaset-card-section-title{color:rgba(0,0,0,.54)}.kd-replicaset-card-title{margin:0}.kd-replicaset-card-description{overflow:auto;white-space:pre-wrap}.kd-replicaset-card-title-row{margin-top:-10px}.kd-replicaset-card-divider{margin-top:8px}.md-button.kd-replicaset-card-logs-button{font-size:inherit;font-weight:inherit;line-height:0;margin:0;min-height:inherit;min-width:inherit;padding:8px 0;text-decoration:none;text-transform:inherit}.kd-menu-logs-item,.kd-menu-logs-item-header{box-sizing:inherit;font-size:14px;white-space:nowrap}.md-button.kd-replicaset-card-logs-button:after{content:' \25BE'}.kd-replicaset-card-section{margin-top:16px}.kd-replicaset-card-section-image{white-space:nowrap}.kd-replicaset-card-label{margin-right:16px}.kd-replicase-card-pods-stat{white-space:nowrap}.kd-menu-logs-item-pods,.kd-menu-logs-item-prior{width:80px}.kd-menu-logs-item-since{width:120px}.md-button.kd-replicaset-card-menu-button{margin:0;position:relative;right:-8px}.md-fab.kd-replicaset-deploy{position:absolute;right:0;top:-36px}.kd-replica-set-list-container{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:column wrap;-ms-flex-flow:column wrap;flex-flow:column wrap;-webkit-box-pack:top;-webkit-justify-content:top;-ms-flex-pack:top;justify-content:top}.kd-help-section>*{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-bottom:20px;padding-right:50px}.kd-user-help *{color:#888}.kd-user-help a{color:#326de6;opacity:1;text-decoration:none}.kd-user-help a:hover{color:#1254df}.kd-user-help b{color:#000}.kd-logs-color-icon{background-color:#000;color:#fff}.kd-logs-color-icon-invert{background-color:#fff;color:#000}.kd-content,.kd-labels{background-color:#eee}md-toolbar md-icon.kd-logs-color-icon-invert{color:#000}.kd-logs-toolbar-text{font-size:16px}.kd-logs-toolbar-select{margin-bottom:16px;margin-left:auto}.kd-zerostate-content{height:90%;position:fixed;width:100%}.kd-zerostate-card-header{font-size:1em}.kd-zerostate-card-logo{height:80px;padding:0 0 0 15px;width:80px}.kd-zerostate-deploy-card{color:#fff;min-width:300px}.kd-zerostate-deploy-bt{font-size:12px;min-width:120px}.kd-zerostate-lm-list{margin-top:10px}.kd-zerostate-lm-list>.kd-zerostate-lm-list-item{color:#326de6;min-height:30px;padding:0}.kd-zerostate-ext-link-icon{font-size:1em}.kd-zerostate-lm-card{font-size:15px;min-width:200px}.kd-zerostate-lm-text{color:#888}.kd-labels{border-radius:8px;display:inline-block;font-size:inherit;margin:0 8px 4px 0;padding:2px 8px;vertical-align:middle}.kd-labels-content{background-color:inherit}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册