Reformat codebase with trailing commas in functions (#2006)

* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-11-22 14:07:41 -05:00
1 parent cb3a9e3bdc
commit bcf004b8a4
423 files changed
+1636 -1605

No files matched your search

@@ -35,7 +35,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
'connection-recording',
{
session_recording: sessionRecordingModel,
}
},
);
const channelRecordingModel = store.createRecord('channel-recording', {
mime_types: [MIME_TYPE_ASCIICAST],
@@ -43,7 +43,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
});
assert.true(
canService.can('getAsciicast channel-recording', channelRecordingModel)
canService.can('getAsciicast channel-recording', channelRecordingModel),
);
});
@@ -58,7 +58,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
'connection-recording',
{
session_recording: sessionRecordingModel,
}
},
);
const channelRecordingModel = store.createRecord('channel-recording', {
mime_types: ['unknown'],
@@ -66,7 +66,7 @@ module('Unit | Ability | channel-recording', function (hooks) {
});
assert.false(
canService.can('getAsciicast channel-recording', channelRecordingModel)
canService.can('getAsciicast channel-recording', channelRecordingModel),
);
});
});
@@ -29,26 +29,26 @@ module('Unit | Ability | session-recording', function (hooks) {
'session-recording',
{
authorized_actions: ['download'],
}
},
);
const recordingWithoutAuthorizedAction = store.createRecord(
'session-recording',
{
authorized_actions: [],
}
},
);
assert.true(
canService.can(
'download session-recording',
recordingWithAuthorizedAction
)
recordingWithAuthorizedAction,
),
);
assert.false(
canService.can(
'download session-recording',
recordingWithoutAuthorizedAction
)
recordingWithoutAuthorizedAction,
),
);
});
});
@@ -80,19 +80,19 @@ module('Unit | Abilities | Target', function (hooks) {
};
assert.true(
canService.can('addInjectedApplicationCredentialSources target', model)
canService.can('addInjectedApplicationCredentialSources target', model),
);
assert.false(
canService.can(
'addInjectedApplicationCredentialSources target',
modelWithoutAuthorizedActions
)
modelWithoutAuthorizedActions,
),
);
assert.false(
canService.can(
'addInjectedApplicationCredentialSources target',
modelWithoutSSHType
)
modelWithoutSSHType,
),
);
});
});
+16 -16
View File
@@ -37,25 +37,25 @@ module('Unit | Abilities | User', function (hooks) {
assert.true(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
assert.true(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_LDAP;
assert.true(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = 'no-such-type';
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
});
@@ -67,25 +67,25 @@ module('Unit | Abilities | User', function (hooks) {
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_LDAP;
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = 'no-such-type';
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
});
@@ -97,25 +97,25 @@ module('Unit | Abilities | User', function (hooks) {
assert.true(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
assert.true(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_LDAP;
assert.true(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = 'no-such-type';
assert.false(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
});
@@ -127,25 +127,25 @@ module('Unit | Abilities | User', function (hooks) {
assert.false(
canService.can('addAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_PASSWORD;
assert.false(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = TYPE_AUTH_METHOD_LDAP;
assert.false(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
instances.account.type = 'no-such-type';
assert.false(
canService.can('removeAccount user', instances.user, {
account: instances.account,
})
}),
);
});
});
@@ -67,7 +67,7 @@ module('Unit | Adapter | application', function (hooks) {
'user',
'1',
mockSnapshot,
'findRecord'
'findRecord',
);
assert.strictEqual(findRecordURL, '/v1/users/1:my-custom-method');
const findAllURL = adapter.buildURL('user', null, mockSnapshot, 'findAll');
@@ -76,28 +76,28 @@ module('Unit | Adapter | application', function (hooks) {
'user',
'2',
mockSnapshot,
'findBelongsTo'
'findBelongsTo',
);
assert.strictEqual(findBelongsToURL, '/v1/users/2:my-custom-method');
const createRecordURL = adapter.buildURL(
'user',
null,
mockSnapshot,
'createRecord'
'createRecord',
);
assert.strictEqual(createRecordURL, '/v1/users:my-custom-method');
const updateRecordURL = adapter.buildURL(
'user',
'3',
mockSnapshot,
'updateRecord'
'updateRecord',
);
assert.strictEqual(updateRecordURL, '/v1/users/3:my-custom-method');
const deleteRecordURL = adapter.buildURL(
'user',
'4',
mockSnapshot,
'deleteRecord'
'deleteRecord',
);
assert.strictEqual(deleteRecordURL, '/v1/users/4:my-custom-method');
});
@@ -109,7 +109,7 @@ module('Unit | Adapter | application', function (hooks) {
assert.strictEqual(
scope_id,
'p_456',
'Scoped resource URL was requested.'
'Scoped resource URL was requested.',
);
return { items: [] };
});
@@ -154,7 +154,7 @@ module('Unit | Adapter | application', function (hooks) {
store,
{ modelName: 'user' },
null,
[]
[],
);
assert.deepEqual(prenormalized, { items: [] });
});
@@ -209,7 +209,7 @@ module('Unit | Adapter | application', function (hooks) {
assert.strictEqual(
handledResponse.errors.length,
2,
'A base error plus one field error'
'A base error plus one field error',
);
});
});
@@ -25,7 +25,7 @@ module('Unit | Adapter | host catalog', function (hooks) {
'host-catalog',
null,
mockSnapshot,
'createRecord'
'createRecord',
);
assert.strictEqual(createRecordURL, '/v1/host-catalogs');
});
@@ -46,7 +46,7 @@ module('Unit | Adapter | host catalog', function (hooks) {
'host-catalog',
null,
mockSnapshot,
'createRecord'
'createRecord',
);
assert.strictEqual(createRecordURL, '/v1/host-catalogs?plugin_name=aws');
});
@@ -25,11 +25,11 @@ module('Unit | Adapter | session recording', function (hooks) {
'sr_id',
mockSnapshot,
'findRecord',
queryObject
queryObject,
);
assert.strictEqual(
createRecordURL,
'/v1/session-recordings/sr_id:download?mime_type=mimeType'
'/v1/session-recordings/sr_id:download?mime_type=mimeType',
);
});
@@ -40,7 +40,7 @@ module('Unit | Adapter | session recording', function (hooks) {
'session-recording',
'sr_id',
{},
'findRecord'
'findRecord',
);
assert.strictEqual(createRecordURL, '/v1/session-recordings/sr_id');
});
@@ -25,11 +25,11 @@ module('Unit | Adapter | storage bucket', function (hooks) {
'storage-bucket',
null,
mockSnapshot,
'createRecord'
'createRecord',
);
assert.strictEqual(
createRecordURL,
'/v1/storage-buckets?plugin_name=aws_s3'
'/v1/storage-buckets?plugin_name=aws_s3',
);
});
});
@@ -40,7 +40,7 @@ module('Unit | Model | auth method', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
store.push({
data: {
+5 -5
View File
@@ -27,12 +27,12 @@ module('Unit | Model | group', function (hooks) {
assert.strictEqual(
group.member_ids.length,
2,
'Group has two entires in member_ids'
'Group has two entires in member_ids',
);
assert.strictEqual(
group.members.length,
0,
'Group has no resolved members because they are not loaded yet'
'Group has no resolved members because they are not loaded yet',
);
store.push({
data: {
@@ -53,12 +53,12 @@ module('Unit | Model | group', function (hooks) {
assert.strictEqual(
group.member_ids.length,
2,
'Group has two entires in member_ids'
'Group has two entires in member_ids',
);
assert.strictEqual(
group.members.length,
2,
'Group has two resolved members'
'Group has two resolved members',
);
});
@@ -168,7 +168,7 @@ module('Unit | Model | group', function (hooks) {
assert.strictEqual(
group.member_ids.length,
0,
'Group has empty member_ids by default'
'Group has empty member_ids by default',
);
});
});
+2 -2
View File
@@ -94,7 +94,7 @@ module('Unit | Model | role', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -132,7 +132,7 @@ module('Unit | Model | role', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
+5 -5
View File
@@ -30,27 +30,27 @@ module('Unit | Model | scope', function (hooks) {
assert.strictEqual(
await scopes.objectAt(1).get('scope.scope_id'),
'global',
'Org 1 parent scope is global'
'Org 1 parent scope is global',
);
assert.strictEqual(
await scopes.objectAt(2).get('scope.scope_id'),
'global',
'Org 2 parent scope is global'
'Org 2 parent scope is global',
);
assert.strictEqual(
await scopes.objectAt(3).get('scope.scope_id'),
'o_1',
'Project 1 parent scope is org 1'
'Project 1 parent scope is org 1',
);
assert.strictEqual(
await scopes.objectAt(4).get('scope.scope_id'),
'o_1',
'Project 2 parent scope is org 1'
'Project 2 parent scope is org 1',
);
assert.strictEqual(
await scopes.objectAt(5).get('scope.scope_id'),
'o_2',
'Project 3 parent scope is org 2'
'Project 3 parent scope is org 2',
);
});
@@ -110,7 +110,7 @@ module('Unit | Model | storage bucket', function (hooks) {
assert.strictEqual(modelPlugin.type, 'plugin');
assert.strictEqual(
modelPlugin.plugin.name,
TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3
TYPE_STORAGE_BUCKET_PLUGIN_AWS_S3,
);
});
});
+17 -17
View File
@@ -31,12 +31,12 @@ module('Unit | Model | target', function (hooks) {
assert.strictEqual(
target.host_sources.length,
2,
'Target has two entires in host_sources'
'Target has two entires in host_sources',
);
assert.strictEqual(
target.hostSets.length,
0,
'Target has no resolved hostSets because they are not loaded yet'
'Target has no resolved hostSets because they are not loaded yet',
);
store.push({
data: {
@@ -55,16 +55,16 @@ module('Unit | Model | target', function (hooks) {
assert.strictEqual(
target.host_sources.length,
2,
'Target has two entires in host_sources'
'Target has two entires in host_sources',
);
assert.strictEqual(
target.hostSets.length,
2,
'Target has two resolved hostSets'
'Target has two resolved hostSets',
);
assert.notOk(
target.hostSets[0].hostCatalog,
'Host catalog was not resolved because it is not loaded yet'
'Host catalog was not resolved because it is not loaded yet',
);
store.push({
data: {
@@ -89,7 +89,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -126,7 +126,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -163,7 +163,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -224,12 +224,12 @@ module('Unit | Model | target', function (hooks) {
assert.strictEqual(
store.peekAll('session').length,
3,
'There are 3 sessions loaded in the store'
'There are 3 sessions loaded in the store',
);
assert.strictEqual(
target.sessions.length,
2,
'Target has two associated sessions loaded in the store'
'Target has two associated sessions loaded in the store',
);
});
@@ -249,12 +249,12 @@ module('Unit | Model | target', function (hooks) {
assert.strictEqual(
target.brokered_credential_source_ids.length,
2,
'Target has two entires in brokered_credential_source_ids'
'Target has two entires in brokered_credential_source_ids',
);
assert.strictEqual(
target.brokeredCredentialSources.length,
0,
'Target has no resolved credentialSources, because they are not yet loaded'
'Target has no resolved credentialSources, because they are not yet loaded',
);
store.push({
data: {
@@ -274,12 +274,12 @@ module('Unit | Model | target', function (hooks) {
assert.strictEqual(
target.brokered_credential_source_ids.length,
2,
'Target has two entires in brokered_credential_source_ids'
'Target has two entires in brokered_credential_source_ids',
);
assert.strictEqual(
target.brokeredCredentialSources.length,
2,
'Target has two resolved credentialSources'
'Target has two resolved credentialSources',
);
});
@@ -294,7 +294,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -328,7 +328,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
@@ -362,7 +362,7 @@ module('Unit | Model | target', function (hooks) {
version: 1,
});
return { id: '123abc' };
}
},
);
const store = this.owner.lookup('service:store');
store.push({
+1 -1
View File
@@ -117,7 +117,7 @@ module('Unit | Model | user', function (hooks) {
assert.strictEqual(
user.account_ids.length,
0,
'User has empty account_ids by default'
'User has empty account_ids by default',
);
});
@@ -205,7 +205,7 @@ module('Unit | Serializer | application', function (hooks) {
const normalizedArray = serializer.normalizeArrayResponse(
store,
userModelClass,
payload
payload,
);
assert.deepEqual(normalizedArray, {
included: [],
@@ -254,7 +254,7 @@ module('Unit | Serializer | application', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
userModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -285,7 +285,7 @@ module('Unit | Serializer | application', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -318,7 +318,7 @@ module('Unit | Serializer | application', function (hooks) {
const normalized = serializer.normalizeUpdateRecordResponse(
store,
user,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -36,7 +36,7 @@ module('Unit | Serializer | auth method', function (hooks) {
assert.ok(serializedRecord);
assert.notOk(
serializedRecord.attributes,
'Password should not have attributes'
'Password should not have attributes',
);
});
@@ -327,7 +327,7 @@ module('Unit | Serializer | auth method', function (hooks) {
const normalizedArray = serializer.normalizeArrayResponse(
store,
modelClass,
payload
payload,
);
assert.ok(payload.items[1].is_primary, 'Second payload item is primary');
assert.deepEqual(
@@ -370,7 +370,7 @@ module('Unit | Serializer | auth method', function (hooks) {
},
],
},
'First normalized item is primary'
'First normalized item is primary',
);
});
@@ -432,7 +432,7 @@ module('Unit | Serializer | auth method', function (hooks) {
assert.strictEqual(record.client_id, clientId);
assert.strictEqual(
record.disable_discovered_config_validation,
disableDiscoveredConfigValidation
disableDiscoveredConfigValidation,
);
assert.strictEqual(record.dry_run, dryRun);
assert.strictEqual(record.issuer, issuer);
@@ -143,7 +143,7 @@ module('Unit | Serializer | credential library', function (hooks) {
name: null,
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
},
'http_request_body attribute is not expected'
'http_request_body attribute is not expected',
);
record.http_method = 'POST';
@@ -161,7 +161,7 @@ module('Unit | Serializer | credential library', function (hooks) {
name: null,
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
},
'http_request_body attribute is expected'
'http_request_body attribute is expected',
);
});
@@ -161,7 +161,7 @@ module('Unit | Serializer | credential store', function (hooks) {
name: null,
type: 'vault',
},
'token attribute is not expected'
'token attribute is not expected',
);
});
@@ -198,7 +198,7 @@ module('Unit | Serializer | credential store', function (hooks) {
name: null,
type: 'vault',
},
'client certificate key attribute is not expected'
'client certificate key attribute is not expected',
);
record.client_certificate_key = 'client-cert-key-456';
@@ -221,7 +221,7 @@ module('Unit | Serializer | credential store', function (hooks) {
name: null,
type: 'vault',
},
'client certificate key attribute is expected'
'client certificate key attribute is expected',
);
});
@@ -63,7 +63,7 @@ module('Unit | Serializer | group', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
group,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -184,7 +184,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostCatalog,
payload
payload,
);
assert.deepEqual(normalized, {
data: {
@@ -234,7 +234,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostCatalog,
payload
payload,
);
assert.deepEqual(normalized, {
data: {
@@ -293,7 +293,7 @@ module('Unit | Serializer | host catalog', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostCatalog,
payload
payload,
);
assert.deepEqual(normalized, {
data: {
@@ -116,7 +116,7 @@ module('Unit | Serializer | host set', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostSetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
@@ -153,7 +153,7 @@ module('Unit | Serializer | host set', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostSet,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -191,7 +191,7 @@ module('Unit | Serializer | host set', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostSetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
@@ -204,7 +204,7 @@ module('Unit | Serializer | Managed group', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostSetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
@@ -64,7 +64,7 @@ module('Unit | Serializer | role', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
roleModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -248,7 +248,7 @@ module('Unit | Serializer | storage bucket', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
hostSetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
@@ -354,7 +354,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
targetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -391,7 +391,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
targetModelClass,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -424,7 +424,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -457,7 +457,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -490,7 +490,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -523,7 +523,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],
@@ -557,7 +557,7 @@ module('Unit | Serializer | target', function (hooks) {
const normalized = serializer.normalizeSingleResponse(
store,
target,
payload
payload,
);
assert.deepEqual(normalized, {
included: [],