Skip to content

Commit

Permalink
Restore linting in CI (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
whscullin authored Aug 9, 2024
1 parent 46c261a commit f730518
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: npm install, build, and test
run: |
npm ci --loglevel error
npm run lint
npm run build
npm run build-duckdb-db
npm run test-silent
Expand Down
8 changes: 4 additions & 4 deletions packages/malloy-render/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"ssf": "^0.11.2",
"us-atlas": "^3.0.0",
"vega": "^5.21.0",
"vega-lite": "^5.2.0"
"vega-lite": "^5.2.0",
"vite": "^5.1.5",
"vite-plugin-solid": "^2.10.1"
},
"devDependencies": {
"@storybook/addon-essentials": "^7.5.0",
Expand All @@ -57,8 +59,6 @@
"@storybook/types": "^7.5.3",
"@types/luxon": "^2.4.0",
"esbuild": "0.19.11",
"storybook": "^7.5.0",
"vite": "^5.1.5",
"vite-plugin-solid": "^2.10.1"
"storybook": "^7.5.0"
}
}
2 changes: 1 addition & 1 deletion packages/malloy-render/src/component/apply-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
AtomicField,
DataArray,
DataColumn,
Explore,
ExploreField,
Field,
Tag,
Expand Down Expand Up @@ -78,6 +77,7 @@ export function applyRenderer(props: RendererProps) {
try {
renderValue = String(dataColumn.value);
} catch (err) {
// eslint-disable-next-line no-console
console.warn('Couldnt get value for ', field, dataColumn);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function registerWebComponent({
withSolid
)(MalloyRender);
} else {
// eslint-disable-next-line no-console
console.warn(
"The custom element 'malloy-render' has already been defined. Make sure you are not loading multiple versions of the malloy-render package as they could conflict."
);
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/component/render-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function renderLink(f: AtomicField, data: DataColumn) {
}
}

let cleanedValue = value.replace(/\//g, '/\u200C');
const cleanedValue = value.replace(/\//g, '/\u200C');
return (
<a target="_blank" href={href}>
{cleanedValue}
Expand Down
1 change: 1 addition & 0 deletions packages/malloy-render/src/html/html_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class HTMLView {
el.result = result;
return el;
} else {
// eslint-disable-next-line no-console
console.warn(
'Tried to use the new Malloy renderer, but the malloy-render component was not found. Falling back to the legacy renderer.'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import {
expressionIsAggregate,
} from '../../../model/malloy_types';
import {expressionIsAggregate} from '../../../model/malloy_types';
import {errorFor} from '../ast-utils';
import {ExprValue} from '../types/expr-value';
import {FieldReference} from '../query-items/field-references';
Expand Down
4 changes: 3 additions & 1 deletion packages/malloy/src/lang/ast/parameters/has-parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ export class HasParameter extends MalloyElement {
type: this.type,
};
} else {
this.default.log("Default value cannot have type `null` unless parameter type is also specified")
this.default.log(
'Default value cannot have type `null` unless parameter type is also specified'
);
return {
value: constant.value,
name: this.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ import {ParameterSpace} from '../field-space/parameter-space';

export class QueryHeadStruct extends Source {
elementType = 'internalOnlyQueryHead';
constructor(readonly fromRef: StructRef, readonly sourceArguments: Record<string, Argument> | undefined) {
constructor(
readonly fromRef: StructRef,
readonly sourceArguments: Record<string, Argument> | undefined
) {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export class QueryReference extends MalloyElement implements QueryElement {
return oops();
}
if (query.type === 'query') {
const queryHead = new QueryHeadStruct(query.structRef, query.sourceArguments);
const queryHead = new QueryHeadStruct(
query.structRef,
query.sourceArguments
);
this.has({queryHead: queryHead});
const inputStruct = queryHead.structDef(undefined);
const outputStruct = getFinalStruct(this, inputStruct, query.pipeline);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class NamedSource extends Source {
const outArguments = this.evaluateArguments(
parameterSpace,
base.parameters,
pList,
pList
);

const ret = {...base, parameters: outParameters, arguments: outArguments};
Expand Down
13 changes: 9 additions & 4 deletions packages/malloy/src/lang/malloy-to-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,11 @@ export class MalloyToAST
return pcx.joinDef().map(jcx => this.visit(jcx));
}

protected getJoinFrom(
cx: parse.JoinFromContext
): {joinAs: ast.ModelEntryReference, joinFrom: ast.SourceQueryElement; notes: Note[]} {
protected getJoinFrom(cx: parse.JoinFromContext): {
joinAs: ast.ModelEntryReference;
joinFrom: ast.SourceQueryElement;
notes: Note[];
} {
const ecx = cx.isExplore();
const joinAs = this.getModelEntryName(cx.joinNameDef());
if (ecx) {
Expand All @@ -528,7 +530,10 @@ export class MalloyToAST
}
const acx = cx.sourceArguments();
if (acx) {
const joinFrom = this.astAt(new ast.SQReference(joinAs, this.getSQArguments(acx)), cx);
const joinFrom = this.astAt(
new ast.SQReference(joinAs, this.getSQArguments(acx)),
cx
);
return {joinFrom, notes: [], joinAs};
}
return {joinAs, joinFrom: new ast.SQReference(joinAs), notes: []};
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy/src/model/malloy_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4156,7 +4156,7 @@ class QueryStruct extends QueryNode {
this._arguments[parameterName] = params[parameterName];
}
// Then, copy over arguments to override default values
const args = { ...this.fieldDef.arguments, ...this.sourceArguments };
const args = {...this.fieldDef.arguments, ...this.sourceArguments};
for (const parameterName in args) {
const orig = args[parameterName];
this._arguments[parameterName] =
Expand Down
1 change: 0 additions & 1 deletion test/src/databases/all/expr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import {RuntimeList, allDatabases} from '../../runtimes';
import '../../util/db-jest-matchers';
import {databasesFromEnvironmentOr, mkSqlEqWith} from '../../util';
import {fail} from 'assert';

const runtimes = new RuntimeList(databasesFromEnvironmentOr(allDatabases));

Expand Down

0 comments on commit f730518

Please sign in to comment.