Skip to content
Snippets Groups Projects
Commit b44962eb authored by Alexander Rose's avatar Alexander Rose
Browse files

lint: add semi-spacing rule

parent c6485149
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,8 @@
"no-multi-spaces": "error",
"block-spacing": "error",
"keyword-spacing": "off",
"space-before-blocks": "error"
"space-before-blocks": "error",
"semi-spacing": "error"
},
"overrides": [
{
......
......@@ -109,7 +109,10 @@ export namespace Tensor {
set: (t, d, x) => t[d] = x,
add: (t, d, x) => t[d] += x,
dataOffset: (d) => d,
getCoords: (o, c) => { c[0] = o; return c as number[]; }
getCoords: (o, c) => {
c[0] = o;
return c as number[];
}
};
case 2: {
// column major
......@@ -120,7 +123,11 @@ export namespace Tensor {
set: (t, i, j, x) => t[j * rows + i] = x,
add: (t, i, j, x) => t[j * rows + i] += x,
dataOffset: (i, j) => j * rows + i,
getCoords: (o, c) => { c[0] = o % rows; c[1] = Math.floor(o / rows) ; return c as number[]; }
getCoords: (o, c) => {
c[0] = o % rows;
c[1] = Math.floor(o / rows);
return c as number[];
}
};
}
if (ao[0] === 1 && ao[1] === 0) {
......@@ -130,7 +137,11 @@ export namespace Tensor {
set: (t, i, j, x) => t[i * cols + j] = x,
add: (t, i, j, x) => t[i * cols + j] += x,
dataOffset: (i, j) => i * cols + j,
getCoords: (o, c) => { c[0] = Math.floor(o / cols); c[1] = o % cols; return c as number[]; }
getCoords: (o, c) => {
c[0] = Math.floor(o / cols);
c[1] = o % cols;
return c as number[];
}
};
}
throw new Error('bad axis order');
......
......@@ -102,7 +102,7 @@ export function parseHelix(lines: Tokens, lineStart: number, lineEnd: number): C
const beg_auth_comp_id = CifField.ofStrings(helices.map(h => h.initResName));
const end_auth_asym_id = CifField.ofStrings(helices.map(h => h.endChainID));
const end_auth_comp_id = CifField.ofStrings(helices.map(h => h.endResName));;
const end_auth_comp_id = CifField.ofStrings(helices.map(h => h.endResName));
const struct_conf: CifCategory.Fields<mmCIF_Schema['struct_conf']> = {
beg_label_asym_id: beg_auth_asym_id,
......
......@@ -127,7 +127,8 @@ export function calcHelixOrientation(model: Model): HelixOrientation {
Vec3.fromArray(v2, centers, e3 - 6);
Vec3.normalize(axis, Vec3.sub(axis, v1, v2));
const eI = traceElementIndex[e];
Vec3.set(a1, x[eI], y[eI], z[eI]);Vec3.copy(vt, a1);
Vec3.set(a1, x[eI], y[eI], z[eI]);
Vec3.copy(vt, a1);
Vec3.projectPointOnVector(vt, vt, axis, v1);
Vec3.toArray(vt, centers, e3);
}
......
......@@ -369,7 +369,7 @@ namespace Unit {
readonly props: CoarseProperties;
getChild(elements: StructureElement.Set): Unit {
if (elements.length === this.elements.length) return this as any as Unit /** lets call this an ugly temporary hack */;
if (elements.length === this.elements.length) return this as any as Unit; // lets call this an ugly temporary hack
return createCoarse(this.id, this.invariantId, this.chainGroupId, this.traits, this.model, this.kind, elements, this.conformation, CoarseProperties());
}
......@@ -465,7 +465,7 @@ namespace Unit {
export class Gaussians extends Coarse<Kind.Gaussians, CoarseGaussianConformation> { }
function createCoarse<K extends Kind.Gaussians | Kind.Spheres>(id: number, invariantId: number, chainGroupId: number, traits: Traits, model: Model, kind: K, elements: StructureElement.Set, conformation: SymmetryOperator.ArrayMapping<ElementIndex>, props: CoarseProperties): K extends Kind.Spheres ? Spheres : Gaussians {
return new Coarse(id, invariantId, chainGroupId, traits, model, kind, elements, conformation, props) as any /** lets call this an ugly temporary hack */;
return new Coarse(id, invariantId, chainGroupId, traits, model, kind, elements, conformation, props) as any; // lets call this an ugly temporary hack
}
export function areSameChainOperatorGroup(a: Unit, b: Unit) {
......
......@@ -207,7 +207,7 @@ export class LineGraphComponent extends React.Component<any, LineGraphComponentS
const updatedPoint = this.unNormalizePoint(Vec2.create(this.updatedX, this.updatedY));
const points = this.state.points.filter((_, i) => i !== selected[0]);
points.push(updatedPoint);;
points.push(updatedPoint);
points.sort((a, b) => {
if (a[0] === b[0]) {
if (a[0] === 0) {
......@@ -372,7 +372,7 @@ export class LineGraphComponent extends React.Component<any, LineGraphComponentS
const data = points;
const size = data.length;
for (let i = 0; i < size - 1;i++) {
for (let i = 0; i < size - 1; i++) {
const x1 = data[i][0];
const y1 = data[i][1];
const x2 = data[i + 1][0];
......
......@@ -153,7 +153,11 @@ export class Sequence<P extends SequenceProps> extends PluginUIComponent<P> {
private getBackgroundColor(marker: number) {
// TODO: make marker color configurable
if (typeof marker === 'undefined') console.error('unexpected marker value');
return marker === 0 ? '' : marker % 2 === 0 ? 'rgb(51, 255, 25)' /* selected */ : 'rgb(255, 102, 153)' /* highlighted */;
return marker === 0
? ''
: marker % 2 === 0
? 'rgb(51, 255, 25)' // selected
: 'rgb(255, 102, 153)'; // highlighted
}
private getResidueClass(seqIdx: number, label: string) {
......
......@@ -92,7 +92,7 @@ export function sizeUTF8(str: string) {
for (let ci = 0; ci < strl; ci++) {
const code = str.charCodeAt(ci);
if ((code & (0xffffffff - (1 << 7) + 1)) === 0) {
i++ ;
i++;
} else if ((code & (0xffffffff - (1 << 11) + 1)) === 0) {
i += 2;
} else if ((code & (0xffffffff - (1 << 16) + 1)) === 0) {
......
......@@ -197,7 +197,7 @@ export function configureLocal() {
description: VOLUME_SERVER_HEADER
});
parser.add_argument('--jobs', { help: `Path to a JSON file with job specification.`, required: false });
parser.add_argument('--jobsTemplate', { help: 'Print example template for jobs.json and exit.', required: false, nargs: 0 });;
parser.add_argument('--jobsTemplate', { help: 'Print example template for jobs.json and exit.', required: false, nargs: 0 });
addJsonConfigArgs(parser);
addLimitsArgs(parser);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment