From 4a4b3ef5b4a6bb60e813c948a34522aa4f4f035c Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Fri, 3 Apr 2020 17:29:59 -0700 Subject: [PATCH] fix whitespace linting issues --- src/apps/basic-wrapper/helpers.ts | 2 +- src/apps/chem-comp-bond/create-table.ts | 2 +- .../structure/structure/unit/bonds.ts | 2 +- .../structure/structure/unit/rings.ts | 4 ++-- .../structure/structure/unit/rings/compute.ts | 2 +- .../structure/util/unit-transforms.ts | 4 ++-- src/mol-plugin-state/actions/data-format.ts | 4 ++-- .../helpers/structure-overpaint.ts | 2 +- src/mol-repr/structure/registry.ts | 2 +- src/mol-repr/volume/registry.ts | 2 +- src/mol-state/action/manager.ts | 8 +++---- src/mol-theme/size/shape-group.ts | 2 +- src/servers/plugin-state/config.ts | 4 ++-- src/servers/plugin-state/index.ts | 6 ++--- src/servers/volume/config.ts | 24 +++++++++---------- 15 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/apps/basic-wrapper/helpers.ts b/src/apps/basic-wrapper/helpers.ts index fea278e4f..b0b364e73 100644 --- a/src/apps/basic-wrapper/helpers.ts +++ b/src/apps/basic-wrapper/helpers.ts @@ -63,7 +63,7 @@ export namespace StateHelper { } export function transform(b: StateBuilder.To<PSO.Molecule.Structure>, matrix: Mat4) { - return b.apply(StateTransforms.Model.TransformStructureConformation, { + return b.apply(StateTransforms.Model.TransformStructureConformation, { transform: { name: 'matrix', params: matrix } }, { tags: 'transform' }); } diff --git a/src/apps/chem-comp-bond/create-table.ts b/src/apps/chem-comp-bond/create-table.ts index 1e26c4935..6fbb74820 100644 --- a/src/apps/chem-comp-bond/create-table.ts +++ b/src/apps/chem-comp-bond/create-table.ts @@ -144,7 +144,7 @@ async function createBonds() { const comp_id: string[] = [] const atom_id_1: string[] = [] const atom_id_2: string[] = [] - const value_order: typeof mmCIF_chemCompBond_schema['value_order']['T'][] = [] + const value_order: typeof mmCIF_chemCompBond_schema['value_order']['T'][] = [] const pdbx_aromatic_flag: typeof mmCIF_chemCompBond_schema['pdbx_aromatic_flag']['T'][] = [] const pdbx_stereo_config: typeof mmCIF_chemCompBond_schema['pdbx_stereo_config']['T'][] = [] const molstar_protonation_variant: string[] = [] diff --git a/src/mol-model/structure/structure/unit/bonds.ts b/src/mol-model/structure/structure/unit/bonds.ts index 2cc0c7b29..ebda56117 100644 --- a/src/mol-model/structure/structure/unit/bonds.ts +++ b/src/mol-model/structure/structure/unit/bonds.ts @@ -19,7 +19,7 @@ export * from './bonds/inter-compute' namespace Bond { export interface Location<U extends Unit = Unit> { readonly kind: 'bond-location', - + aStructure: Structure, aUnit: U, /** Index into aUnit.elements */ diff --git a/src/mol-model/structure/structure/unit/rings.ts b/src/mol-model/structure/structure/unit/rings.ts index 84eb3ac0c..c7776ba61 100644 --- a/src/mol-model/structure/structure/unit/rings.ts +++ b/src/mol-model/structure/structure/unit/rings.ts @@ -157,11 +157,11 @@ namespace UnitRings { /** Creates a mapping ResidueIndex -> list or rings that are on that residue and have one of the specified fingerprints. */ export function byFingerprintAndResidue(rings: UnitRings, fingerprints: ReadonlyArray<UnitRing.Fingerprint>) { const map = new Map<ResidueIndex, Index[]>(); - + for (let fI = 0, _fI = fingerprints.length; fI < _fI; fI++) { const fp = fingerprints[fI]; addSingleResidueRings(rings, fp, map); - } + } return map; } } diff --git a/src/mol-model/structure/structure/unit/rings/compute.ts b/src/mol-model/structure/structure/unit/rings/compute.ts index 4f93aec8b..3c84b1d73 100644 --- a/src/mol-model/structure/structure/unit/rings/compute.ts +++ b/src/mol-model/structure/structure/unit/rings/compute.ts @@ -116,7 +116,7 @@ function processResidue(state: State, start: number, end: number) { arraySetAdd(altLocs, altLoc); } arraySetRemove(altLocs, ''); - + if (altLocs.length === 0) { resetState(state); for (let i = 0; i < state.count; i++) { diff --git a/src/mol-model/structure/structure/util/unit-transforms.ts b/src/mol-model/structure/structure/util/unit-transforms.ts index f2de9309b..0fb9d319d 100644 --- a/src/mol-model/structure/structure/util/unit-transforms.ts +++ b/src/mol-model/structure/structure/util/unit-transforms.ts @@ -18,9 +18,9 @@ export class StructureUnitTransforms { private unitOffsetMap = IntMap.Mutable<number>(); private groupIndexMap = IntMap.Mutable<number>(); private size: number; - + private _isIdentity: boolean | undefined = undefined; - + version = 0; constructor(readonly structure: Structure) { diff --git a/src/mol-plugin-state/actions/data-format.ts b/src/mol-plugin-state/actions/data-format.ts index feaf4da09..eb1a3ce22 100644 --- a/src/mol-plugin-state/actions/data-format.ts +++ b/src/mol-plugin-state/actions/data-format.ts @@ -137,12 +137,12 @@ export const OpenFiles = StateAction.build({ const info = getFileInfo(file) const isBinary = plugin.dataFormat.registry.binaryExtensions.has(info.ext) const { data } = await plugin.builders.data.readFile({ file, isBinary }); - //const data = state.build().toRoot().apply(StateTransforms.Data.ReadFile, { file, isBinary }); + // const data = state.build().toRoot().apply(StateTransforms.Data.ReadFile, { file, isBinary }); // const dataStateObject = await state.updateTree(data).runInContext(taskCtx); const provider = params.format === 'auto' ? plugin.dataFormat.registry.auto(info, data.cell?.obj!) : plugin.dataFormat.registry.get(params.format) - + // need to await so that the enclosing Task finishes after the update is done. await provider.getDefaultBuilder(plugin, data, { visuals: params.visuals }, state).runInContext(taskCtx) } catch (e) { diff --git a/src/mol-plugin-state/helpers/structure-overpaint.ts b/src/mol-plugin-state/helpers/structure-overpaint.ts index 9eda24d32..cc977e397 100644 --- a/src/mol-plugin-state/helpers/structure-overpaint.ts +++ b/src/mol-plugin-state/helpers/structure-overpaint.ts @@ -56,7 +56,7 @@ export async function clearStructureOverpaint(plugin: PluginContext, components: } async function eachRepr(plugin: PluginContext, components: StructureComponentRef[], callback: OverpaintEachReprCallback) { - const state = plugin.state.data; + const state = plugin.state.data; const update = state.build(); for (const c of components) { for (const r of c.representations) { diff --git a/src/mol-repr/structure/registry.ts b/src/mol-repr/structure/registry.ts index 13db289ed..e64bc74ae 100644 --- a/src/mol-repr/structure/registry.ts +++ b/src/mol-repr/structure/registry.ts @@ -45,7 +45,7 @@ export namespace StructureRepresentationRegistry { 'putty': PuttyRepresentationProvider, 'spacefill': SpacefillRepresentationProvider, } - + type _BuiltIn = typeof BuiltIn export type BuiltIn = keyof _BuiltIn export type BuiltInParams<T extends BuiltIn> = Partial<RepresentationProvider.ParamValues<_BuiltIn[T]>> diff --git a/src/mol-repr/volume/registry.ts b/src/mol-repr/volume/registry.ts index 05ed2a879..758371e1e 100644 --- a/src/mol-repr/volume/registry.ts +++ b/src/mol-repr/volume/registry.ts @@ -11,7 +11,7 @@ import { objectForEach } from '../../mol-util/object'; export class VolumeRepresentationRegistry extends RepresentationRegistry<VolumeData, Representation.State> { constructor() { - super() + super() objectForEach(VolumeRepresentationRegistry.BuiltIn, (p, k) => { if (p.name !== k) throw new Error(`Fix BuiltInVolumeRepresentations to have matching names. ${p.name} ${k}`); this.add(p as any) diff --git a/src/mol-state/action/manager.ts b/src/mol-state/action/manager.ts index 365975f7c..a285a1a7e 100644 --- a/src/mol-state/action/manager.ts +++ b/src/mol-state/action/manager.ts @@ -35,11 +35,11 @@ class StateActionManager { } remove(actionOrTransformer: StateAction | StateTransformer | UUID) { - const id = StateTransformer.is(actionOrTransformer) - ? actionOrTransformer.toAction().id + const id = StateTransformer.is(actionOrTransformer) + ? actionOrTransformer.toAction().id : UUID.is(actionOrTransformer) - ? actionOrTransformer - : actionOrTransformer.id; + ? actionOrTransformer + : actionOrTransformer.id; const action = this.actions.get(id); if (!action) return this; diff --git a/src/mol-theme/size/shape-group.ts b/src/mol-theme/size/shape-group.ts index 811b1cb95..9537c7bc5 100644 --- a/src/mol-theme/size/shape-group.ts +++ b/src/mol-theme/size/shape-group.ts @@ -37,7 +37,7 @@ export function ShapeGroupSizeTheme(ctx: ThemeDataContext, props: PD.Values<Shap export const ShapeGroupSizeThemeProvider: SizeTheme.Provider<ShapeGroupSizeThemeParams, 'shape-group'> = { name: 'shape-group', label: 'Shape Group', - category: '', + category: '', factory: ShapeGroupSizeTheme, getParams: getShapeGroupSizeThemeParams, defaultValues: PD.getDefaultValues(ShapeGroupSizeThemeParams), diff --git a/src/servers/plugin-state/config.ts b/src/servers/plugin-state/config.ts index a7336f784..8cd474926 100644 --- a/src/servers/plugin-state/config.ts +++ b/src/servers/plugin-state/config.ts @@ -21,8 +21,8 @@ export function getConfig() { cmdParser.addArgument(['--port'], { help: 'Server port. Altenatively use ENV variable PORT.', type: 'int', required: false }); cmdParser.addArgument(['--api-prefix'], { help: 'Server API prefix.', defaultValue: '', required: false }); cmdParser.addArgument(['--max-states'], { help: 'Maxinum number of states that could be saved.', defaultValue: 40, type: 'int', required: false }); - - const config = cmdParser.parseArgs() as Config; + + const config = cmdParser.parseArgs() as Config; if (!config.port) config.port = process.env.port || 1339; return config; } diff --git a/src/servers/plugin-state/index.ts b/src/servers/plugin-state/index.ts index ba0e2d251..f8cd83631 100644 --- a/src/servers/plugin-state/index.ts +++ b/src/servers/plugin-state/index.ts @@ -47,8 +47,8 @@ function readIndex() { function validateIndex(index: Index) { if (index.length > Config.max_states) { const deletes: Index = [], newIndex: Index = []; - const toDelete = index.length - Config.max_states; - + const toDelete = index.length - Config.max_states; + for (const e of index) { if (!e.isSticky && deletes.length < toDelete) { deletes.push(e); @@ -71,7 +71,7 @@ function remove(id: string) { let index = readIndex(); let i = 0; for (const e of index) { - if (e.id !== id) { + if (e.id !== id) { i++; continue; } diff --git a/src/servers/volume/config.ts b/src/servers/volume/config.ts index 464739433..286483701 100644 --- a/src/servers/volume/config.ts +++ b/src/servers/volume/config.ts @@ -84,12 +84,12 @@ function addServerArgs(parser: argparse.ArgumentParser) { } function addJsonConfigArgs(parser: argparse.ArgumentParser) { - parser.addArgument(['--cfg'], { + parser.addArgument(['--cfg'], { help: [ 'JSON config file path', 'If a property is not specified, cmd line param/OS variable/default value are used.' ].join('\n'), - required: false + required: false }); parser.addArgument(['--printCfg'], { help: 'Print current config for validation and exit.', required: false, nargs: 0 }); parser.addArgument(['--cfgTemplate'], { help: 'Prints default JSON config template to be modified and exits.', required: false, nargs: 0 }); @@ -169,25 +169,25 @@ export function configureServer() { console.log(JSON.stringify(ServerConfigTemplate, null, 2)); process.exit(0); } - + try { setConfig(config) // sets the config for global use - + if (config.cfg) { const cfg = JSON.parse(fs.readFileSync(config.cfg, 'utf8')) as FullServerConfig; setConfig(cfg); } - + if (config.printCfg !== null) { console.log(JSON.stringify({ ...ServerConfig, ...LimitsConfig }, null, 2)); process.exit(0); } - + validateServerConfig(); } catch (e) { console.error('' + e); process.exit(1); - } + } } export function configureLocal() { @@ -207,23 +207,23 @@ export function configureLocal() { console.log(JSON.stringify(DefaultLimitsConfig, null, 2)); process.exit(0); } - + try { setLimitsConfig(config) // sets the config for global use - + if (config.cfg) { const cfg = JSON.parse(fs.readFileSync(config.cfg, 'utf8')) as FullServerConfig; setLimitsConfig(cfg); } - + if (config.printCfg !== null) { console.log(JSON.stringify(LimitsConfig, null, 2)); process.exit(0); } - + return config as LimitsConfig & { jobs: string, jobsTemplate: any }; } catch (e) { console.error('' + e); process.exit(1); - } + } } \ No newline at end of file -- GitLab