@eagleoutice/flowr 2.17.13 → 2.17.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/cli/repl/core.js +9 -27
- package/data/r-datasets.generated.js +2 -2
- package/dataflow/environments/ambient-effect.d.ts +4 -0
- package/dataflow/environments/ambient-effect.js +5 -4
- package/dataflow/environments/ambient-state-name.d.ts +2 -2
- package/dataflow/environments/ambient-state-name.js +3 -3
- package/dataflow/environments/built-in-props.d.ts +5 -0
- package/dataflow/environments/default-builtin-config/base-functions.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-functions.js +4 -2
- package/dataflow/environments/default-builtin-config/base-language.d.ts +12 -1
- package/dataflow/environments/default-builtin-config/base-language.js +3 -2
- package/dataflow/environments/default-builtin-config/index.d.ts +12 -2
- package/dataflow/environments/default-builtin-config/misc-packages.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/misc-packages.js +2 -0
- package/dataflow/environments/default-builtin-config/shared-configs.d.ts +24 -0
- package/dataflow/environments/default-builtin-config/shared-configs.js +8 -6
- package/dataflow/environments/pkg-name.d.ts +1 -0
- package/dataflow/eval/resolve/alias-tracking.js +11 -12
- package/dataflow/graph/df-helper.d.ts +6 -6
- package/dataflow/graph/df-helper.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +18 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +29 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +12 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +24 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +10 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -2
- package/documentation/doc-readme.js +1 -2
- package/documentation/doc-util/doc-query.d.ts +1 -1
- package/documentation/doc-util/doc-query.js +4 -2
- package/documentation/wiki-linter.d.ts +2 -0
- package/documentation/wiki-linter.js +7 -1
- package/documentation/wiki-query.js +28 -0
- package/linter/linter-format.d.ts +5 -1
- package/linter/linter-format.js +4 -0
- package/linter/linter-output.js +18 -16
- package/linter/linter-rules.d.ts +50 -0
- package/linter/linter-rules.js +5 -1
- package/linter/rules/notebook-cell-order.d.ts +43 -0
- package/linter/rules/notebook-cell-order.js +97 -0
- package/linter/rules/project-entry-point.d.ts +53 -0
- package/linter/rules/project-entry-point.js +62 -0
- package/linter/rules/undefined-symbol.d.ts +2 -0
- package/linter/rules/undefined-symbol.js +6 -1
- package/notebook/cell-graph.d.ts +23 -0
- package/notebook/cell-graph.js +48 -0
- package/notebook/cell-order-mermaid.d.ts +16 -0
- package/notebook/cell-order-mermaid.js +51 -0
- package/notebook/cell-order.d.ts +270 -0
- package/notebook/cell-order.js +1452 -0
- package/notebook/cell-split.d.ts +27 -0
- package/notebook/cell-split.js +99 -0
- package/package.json +1 -1
- package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -0
- package/project/context/flowr-analyzer-files-context.d.ts +2 -0
- package/project/flowr-analyzer.js +5 -1
- package/project/plugins/file-plugins/files/cell-runner.d.ts +22 -0
- package/project/plugins/file-plugins/files/cell-runner.js +32 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +22 -6
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +22 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +63 -7
- package/project/plugins/file-plugins/files/flowr-rsession-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rsession-file.js +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +3 -5
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +6 -0
- package/project/plugins/file-plugins/files/recorded-runs.d.ts +2 -0
- package/queries/catalog/aliases-query/aliases-query-executor.d.ts +6 -0
- package/queries/catalog/aliases-query/aliases-query-executor.js +108 -0
- package/queries/catalog/aliases-query/aliases-query-format.d.ts +21 -0
- package/queries/catalog/aliases-query/aliases-query-format.js +34 -0
- package/queries/catalog/cell-order-query/cell-order-query-format.d.ts +81 -0
- package/queries/catalog/cell-order-query/cell-order-query-format.js +82 -0
- package/queries/catalog/linter-query/linter-query-format.js +2 -1
- package/queries/query.d.ts +17 -2
- package/queries/query.js +6 -2
- package/queries/virtual-query/compound-query.d.ts +1 -1
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/mermaid/ast.js +4 -11
- package/util/mermaid/cfg.js +1 -2
- package/util/mermaid/dfg.d.ts +5 -0
- package/util/mermaid/dfg.js +23 -4
- package/util/mermaid/mermaid.d.ts +5 -0
- package/util/mermaid/mermaid.js +8 -0
- package/util/r-datasets.d.ts +2 -0
- package/util/r-datasets.js +3 -0
- package/util/text/playground-link.d.ts +2 -2
- package/util/text/playground-link.js +2 -2
package/linter/linter-rules.d.ts
CHANGED
|
@@ -1296,6 +1296,56 @@ export declare const LintingRules: {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
};
|
|
1298
1298
|
};
|
|
1299
|
+
readonly 'notebook-cell-order': {
|
|
1300
|
+
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"from", [], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
1301
|
+
readonly processSearchResult: (_elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: import("../util/objects").MergeableRecord, data: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
1302
|
+
results: import("./rules/notebook-cell-order").NotebookCellOrderResult[];
|
|
1303
|
+
'.meta': {};
|
|
1304
|
+
}>;
|
|
1305
|
+
readonly prettyPrint: {
|
|
1306
|
+
readonly query: (r: import("./rules/notebook-cell-order").NotebookCellOrderResult, metadata: unknown) => string;
|
|
1307
|
+
readonly full: (r: import("./rules/notebook-cell-order").NotebookCellOrderResult, metadata: unknown) => string;
|
|
1308
|
+
};
|
|
1309
|
+
readonly info: {
|
|
1310
|
+
readonly name: "Notebook Cell Order";
|
|
1311
|
+
readonly tags: readonly [LintingRuleTag.Reproducibility, LintingRuleTag.Bug, LintingRuleTag.QuickFix];
|
|
1312
|
+
readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
|
|
1313
|
+
readonly description: "Finds notebook cells that read what only a cell further down provides, so the notebook fails or behaves differently when run top to bottom, and offers to move the providing cell up.";
|
|
1314
|
+
readonly defaultConfig: () => {};
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
readonly 'project-entry-point': {
|
|
1318
|
+
readonly createSearch: () => import("../search/flowr-search-builder").FlowrSearchBuilder<"from", [], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
1319
|
+
readonly processSearchResult: (_elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: import("../util/objects").MergeableRecord, data: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
1320
|
+
results: {
|
|
1321
|
+
certainty: import("./linter-format").LintingResultCertainty;
|
|
1322
|
+
involvedId: import("..").NodeId;
|
|
1323
|
+
loc: readonly [startLine: import("../util/range").Line, startColumn: import("../util/range").Column, endLine: import("../util/range").Line, endColumn: import("../util/range").Column, f?: string | undefined] | undefined;
|
|
1324
|
+
files: string[];
|
|
1325
|
+
runs: boolean;
|
|
1326
|
+
reads: string[];
|
|
1327
|
+
entry: string;
|
|
1328
|
+
quickFix: {
|
|
1329
|
+
type: "replace";
|
|
1330
|
+
description: string;
|
|
1331
|
+
loc: readonly [startLine: import("../util/range").Line, startColumn: import("../util/range").Column, endLine: import("../util/range").Line, endColumn: import("../util/range").Column, f?: string | undefined];
|
|
1332
|
+
replacement: string;
|
|
1333
|
+
}[] | undefined;
|
|
1334
|
+
}[];
|
|
1335
|
+
'.meta': {};
|
|
1336
|
+
}>;
|
|
1337
|
+
readonly prettyPrint: {
|
|
1338
|
+
readonly query: (r: import("./rules/project-entry-point").ProjectEntryPointResult, metadata: unknown) => string;
|
|
1339
|
+
readonly full: (r: import("./rules/project-entry-point").ProjectEntryPointResult, metadata: unknown) => string;
|
|
1340
|
+
};
|
|
1341
|
+
readonly info: {
|
|
1342
|
+
readonly name: "Project Entry Point";
|
|
1343
|
+
readonly tags: readonly [LintingRuleTag.Reproducibility, LintingRuleTag.Smell, LintingRuleTag.QuickFix];
|
|
1344
|
+
readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
|
|
1345
|
+
readonly description: "Finds projects whose scripts read what other scripts define but that have no entry file (such as a main.R, a makefile, or _targets.R) that runs them in an order that works, and suggests a main.R that sources them in one.";
|
|
1346
|
+
readonly defaultConfig: () => {};
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1299
1349
|
};
|
|
1300
1350
|
export type LintingRuleNames = keyof typeof LintingRules;
|
|
1301
1351
|
/**
|
package/linter/linter-rules.js
CHANGED
|
@@ -22,6 +22,8 @@ const software_has_tests_1 = require("./rules/software-has-tests");
|
|
|
22
22
|
const no_leaked_credentials_1 = require("./rules/no-leaked-credentials");
|
|
23
23
|
const undefined_symbol_1 = require("./rules/undefined-symbol");
|
|
24
24
|
const unused_import_1 = require("./rules/unused-import");
|
|
25
|
+
const notebook_cell_order_1 = require("./rules/notebook-cell-order");
|
|
26
|
+
const project_entry_point_1 = require("./rules/project-entry-point");
|
|
25
27
|
const syntactically_valid_1 = require("./rules/syntactically-valid");
|
|
26
28
|
const unclosed_connection_1 = require("./rules/unclosed-connection");
|
|
27
29
|
const overwritten_file_1 = require("./rules/overwritten-file");
|
|
@@ -104,7 +106,9 @@ exports.LintingRules = {
|
|
|
104
106
|
'code-clones': code_clones_1.CODE_CLONES,
|
|
105
107
|
'call-contracts': call_contracts_1.CALL_CONTRACTS,
|
|
106
108
|
'interactive-functions': interactive_functions_1.INTERACTIVE_FUNCTIONS,
|
|
107
|
-
'autoload-files': autoload_files_1.AUTOLOAD_FILES
|
|
109
|
+
'autoload-files': autoload_files_1.AUTOLOAD_FILES,
|
|
110
|
+
'notebook-cell-order': notebook_cell_order_1.NOTEBOOK_CELL_ORDER,
|
|
111
|
+
'project-entry-point': project_entry_point_1.PROJECT_ENTRY_POINT
|
|
108
112
|
};
|
|
109
113
|
const DigitWords = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
|
|
110
114
|
/**
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
3
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
4
|
+
import { type CellIndex, CellResource } from '../../notebook/cell-order';
|
|
5
|
+
/** the rule has nothing to configure */
|
|
6
|
+
export type NotebookCellOrderConfig = MergeableRecord;
|
|
7
|
+
export interface NotebookCellOrderResult extends LintingResult {
|
|
8
|
+
/** the name the cell reads before any cell above binds it */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** what the name stands for: a variable, a package the called function comes from, a file, or global state */
|
|
11
|
+
readonly resource: CellResource;
|
|
12
|
+
/** the reading cell */
|
|
13
|
+
readonly cell: CellIndex;
|
|
14
|
+
/** the cells that bind it */
|
|
15
|
+
readonly providers: readonly CellIndex[];
|
|
16
|
+
/** the lines the code of {@link NotebookCellOrderResult#providers} starts at, which say the cells whatever counts them */
|
|
17
|
+
readonly providedAt: readonly number[];
|
|
18
|
+
/** whether a cell above that binds it fails itself when the notebook runs top to bottom, so it never binds it */
|
|
19
|
+
readonly providerFails?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Flags reads of a notebook cell that only work if a cell further down ran before, so the notebook does not run top to bottom,
|
|
23
|
+
* and offers to move that cell up. Reads of global state, like an option another cell sets, are only uncertain findings,
|
|
24
|
+
* as the cell runs either way, but does something else.
|
|
25
|
+
*/
|
|
26
|
+
export declare const NOTEBOOK_CELL_ORDER: {
|
|
27
|
+
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
28
|
+
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: MergeableRecord, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
29
|
+
results: NotebookCellOrderResult[];
|
|
30
|
+
'.meta': {};
|
|
31
|
+
}>;
|
|
32
|
+
readonly prettyPrint: {
|
|
33
|
+
readonly query: (r: NotebookCellOrderResult, metadata: unknown) => string;
|
|
34
|
+
readonly full: (r: NotebookCellOrderResult, metadata: unknown) => string;
|
|
35
|
+
};
|
|
36
|
+
readonly info: {
|
|
37
|
+
readonly name: "Notebook Cell Order";
|
|
38
|
+
readonly tags: readonly [LintingRuleTag.Reproducibility, LintingRuleTag.Bug, LintingRuleTag.QuickFix];
|
|
39
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
40
|
+
readonly description: "Finds notebook cells that read what only a cell further down provides, so the notebook fails or behaves differently when run top to bottom, and offers to move the providing cell up.";
|
|
41
|
+
readonly defaultConfig: () => {};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NOTEBOOK_CELL_ORDER = void 0;
|
|
4
|
+
const linter_format_1 = require("../linter-format");
|
|
5
|
+
const linter_tags_1 = require("../linter-tags");
|
|
6
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
7
|
+
const range_1 = require("../../util/range");
|
|
8
|
+
const cell_split_1 = require("../../notebook/cell-split");
|
|
9
|
+
const cell_order_1 = require("../../notebook/cell-order");
|
|
10
|
+
/** A change of the lines `from` to `to` to `text` as a quick fix. */
|
|
11
|
+
const replaceLines = (rows, change, description, file) => ({
|
|
12
|
+
type: 'replace',
|
|
13
|
+
description,
|
|
14
|
+
loc: range_1.SourceLocation.from(range_1.SourceRange.from(change.from, 1, change.to, Math.max(1, (rows[change.to - 1] ?? '').length)), file),
|
|
15
|
+
replacement: change.text
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* The fixes to choose from: moving the cells so that the notebook runs top to bottom, the text between them staying or moving along with the cell below it.
|
|
19
|
+
* Cells that need each other in a cycle no order mends, so then one statement moves out of its cell into one of its own.
|
|
20
|
+
*/
|
|
21
|
+
async function reorder(rows, facts, file, analyzer) {
|
|
22
|
+
const moves = [[false, 'Reorder the cells to run top to bottom'], [true, 'Reorder the cells with the text above each']].flatMap(([withText, description]) => {
|
|
23
|
+
const change = (0, cell_order_1.reorderCells)(rows, facts, withText);
|
|
24
|
+
return change === undefined ? [] : [replaceLines(rows, change, description, file)];
|
|
25
|
+
});
|
|
26
|
+
if (moves.length > 0) {
|
|
27
|
+
return moves;
|
|
28
|
+
}
|
|
29
|
+
const split = await (0, cell_split_1.splitForCycle)(analyzer);
|
|
30
|
+
const change = split === undefined ? undefined : (0, cell_split_1.applySplit)(rows, facts, split);
|
|
31
|
+
return change === undefined || split === undefined ? [] : [replaceLines(rows, change, `The cells need each other: move lines ${split.from} to ${split.to} into a cell of their own ${split.before === undefined ? 'at the end' : `above the cell at line ${facts[split.before].cell.from}`}`, file)];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Flags reads of a notebook cell that only work if a cell further down ran before, so the notebook does not run top to bottom,
|
|
35
|
+
* and offers to move that cell up. Reads of global state, like an option another cell sets, are only uncertain findings,
|
|
36
|
+
* as the cell runs either way, but does something else.
|
|
37
|
+
*/
|
|
38
|
+
exports.NOTEBOOK_CELL_ORDER = {
|
|
39
|
+
createSearch: () => flowr_search_builder_1.Q.from([]),
|
|
40
|
+
processSearchResult: async (_elements, _config, data) => {
|
|
41
|
+
const facts = await (0, cell_order_1.analyzeNotebook)(data);
|
|
42
|
+
const files = data.inspectContext().files;
|
|
43
|
+
const file = files.getAllFiles().find(f => (0, cell_order_1.notebookCells)(f).length > 0);
|
|
44
|
+
/* the text of the notebook, from its file, or the code itself when it is given as text */
|
|
45
|
+
const text = file === undefined ? files.loadingOrder.getUnorderedRequests().find(r => r.request === 'text')?.content
|
|
46
|
+
: 'rawText' in file && typeof file.rawText === 'function' ? String(file.rawText()) : file.content().toString();
|
|
47
|
+
const rows = (text ?? '').split(/\r?\n/);
|
|
48
|
+
const ast = await data.normalize();
|
|
49
|
+
const fix = await reorder(rows, facts, file?.path(), data);
|
|
50
|
+
const failures = (0, cell_order_1.checkOrder)(facts, facts.map((_, i) => i));
|
|
51
|
+
const fails = new Set(failures.filter(f => f.missing.some(m => !m.soft)).map(f => f.cell));
|
|
52
|
+
const results = failures.flatMap(({ cell, missing }) => missing.map(need => {
|
|
53
|
+
const loc = range_1.SourceLocation.fromNode(ast.idMap.get(need.id));
|
|
54
|
+
return {
|
|
55
|
+
certainty: need.soft ? linter_format_1.LintingResultCertainty.Uncertain : linter_format_1.LintingResultCertainty.Certain,
|
|
56
|
+
involvedId: need.id,
|
|
57
|
+
loc,
|
|
58
|
+
name: need.name,
|
|
59
|
+
resource: need.resource,
|
|
60
|
+
cell,
|
|
61
|
+
providers: need.providers,
|
|
62
|
+
providedAt: need.providers.map(p => facts[p].cell.from),
|
|
63
|
+
providerFails: need.providers.some(p => p < cell && fails.has(p)),
|
|
64
|
+
/* only cells with fences or markers can be moved as text, a transcript or the json of a notebook cannot */
|
|
65
|
+
/* each fix is a single edit, the reorders are alternatives to one another */
|
|
66
|
+
quickFix: fix.length > 0 ? fix.slice(0, 1) : undefined,
|
|
67
|
+
alternatives: fix.length > 1 ? fix.slice(1).map(f => [f]) : undefined
|
|
68
|
+
};
|
|
69
|
+
}));
|
|
70
|
+
return { results, '.meta': {} };
|
|
71
|
+
},
|
|
72
|
+
prettyPrint: (0, linter_format_1.prettyPrintAt)(r => r.resource === cell_order_1.CellResource.File || r.resource === cell_order_1.CellResource.State ? (0, cell_order_1.describeSymbol)(r) : `\`${r.name}\``, r => {
|
|
73
|
+
const at = `the cell at line ${r.providedAt.join(' or ')}`;
|
|
74
|
+
if (r.providers.length === 0) {
|
|
75
|
+
return 'is drawn on, but each cell starts with a new plot when the notebook is knitted, so this fails.';
|
|
76
|
+
}
|
|
77
|
+
/* every cell binding it is above, so it is not the order of these two that fails, but what happens in between */
|
|
78
|
+
if (r.providers.every(p => p < r.cell)) {
|
|
79
|
+
return r.providerFails ? `comes from ${at}, but that cell fails itself, so the notebook fails when run top to bottom.`
|
|
80
|
+
: `comes from ${at}, but is removed again before this cell, so the notebook fails when run top to bottom.`;
|
|
81
|
+
}
|
|
82
|
+
switch (r.resource) {
|
|
83
|
+
case cell_order_1.CellResource.Package: return `comes from a package that only ${at} loads, so the notebook fails when run top to bottom.`;
|
|
84
|
+
case cell_order_1.CellResource.File: return `is read before ${at} writes it, so the notebook fails on a fresh checkout.`;
|
|
85
|
+
case cell_order_1.CellResource.State: return `is used before ${at} sets it, so the result depends on the order.`;
|
|
86
|
+
default: return `is used before ${at} defines it, so the notebook fails when run top to bottom.`;
|
|
87
|
+
}
|
|
88
|
+
}),
|
|
89
|
+
info: {
|
|
90
|
+
name: 'Notebook Cell Order',
|
|
91
|
+
tags: [linter_tags_1.LintingRuleTag.Reproducibility, linter_tags_1.LintingRuleTag.Bug, linter_tags_1.LintingRuleTag.QuickFix],
|
|
92
|
+
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
93
|
+
description: 'Finds notebook cells that read what only a cell further down provides, so the notebook fails or behaves differently when run top to bottom, and offers to move the providing cell up.',
|
|
94
|
+
defaultConfig: () => ({})
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=notebook-cell-order.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type LintingResult, LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
3
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
4
|
+
/** the rule has nothing to configure */
|
|
5
|
+
export type ProjectEntryPointConfig = MergeableRecord;
|
|
6
|
+
export interface ProjectEntryPointResult extends LintingResult {
|
|
7
|
+
/** the files of the project that depend on each other, in an order they run in if there is one, else in the loading order */
|
|
8
|
+
readonly files: readonly string[];
|
|
9
|
+
/** whether {@link ProjectEntryPointResult#files} is an order in which the files run */
|
|
10
|
+
readonly runs: boolean;
|
|
11
|
+
/** what the files read of each other, as `b.R reads x from a.R` */
|
|
12
|
+
readonly reads: readonly string[];
|
|
13
|
+
/** a `main.R` that sources the files in that order */
|
|
14
|
+
readonly entry: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Flags a project whose scripts read what other scripts define, but which has no file that runs them in an order that
|
|
18
|
+
* works (a `main.R`, a makefile, `_targets.R`, or a package), and suggests a `main.R` that sources them in one.
|
|
19
|
+
* The files are the units here, as the cells of a notebook are for `notebook-cell-order`: a notebook counts as one file,
|
|
20
|
+
* and a file another file sources runs as part of it.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PROJECT_ENTRY_POINT: {
|
|
23
|
+
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from", [], import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
24
|
+
readonly processSearchResult: (_elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, _config: MergeableRecord, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
25
|
+
results: {
|
|
26
|
+
certainty: LintingResultCertainty;
|
|
27
|
+
involvedId: import("../..").NodeId;
|
|
28
|
+
loc: readonly [startLine: import("../../util/range").Line, startColumn: import("../../util/range").Column, endLine: import("../../util/range").Line, endColumn: import("../../util/range").Column, f?: string | undefined] | undefined;
|
|
29
|
+
files: string[];
|
|
30
|
+
runs: boolean;
|
|
31
|
+
reads: string[];
|
|
32
|
+
entry: string;
|
|
33
|
+
quickFix: {
|
|
34
|
+
type: "replace";
|
|
35
|
+
description: string;
|
|
36
|
+
loc: readonly [startLine: import("../../util/range").Line, startColumn: import("../../util/range").Column, endLine: import("../../util/range").Line, endColumn: import("../../util/range").Column, f?: string | undefined];
|
|
37
|
+
replacement: string;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
'.meta': {};
|
|
41
|
+
}>;
|
|
42
|
+
readonly prettyPrint: {
|
|
43
|
+
readonly query: (r: ProjectEntryPointResult, metadata: unknown) => string;
|
|
44
|
+
readonly full: (r: ProjectEntryPointResult, metadata: unknown) => string;
|
|
45
|
+
};
|
|
46
|
+
readonly info: {
|
|
47
|
+
readonly name: "Project Entry Point";
|
|
48
|
+
readonly tags: readonly [LintingRuleTag.Reproducibility, LintingRuleTag.Smell, LintingRuleTag.QuickFix];
|
|
49
|
+
readonly certainty: LintingRuleCertainty.BestEffort;
|
|
50
|
+
readonly description: "Finds projects whose scripts read what other scripts define but that have no entry file (such as a main.R, a makefile, or _targets.R) that runs them in an order that works, and suggests a main.R that sources them in one.";
|
|
51
|
+
readonly defaultConfig: () => {};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROJECT_ENTRY_POINT = void 0;
|
|
4
|
+
const linter_format_1 = require("../linter-format");
|
|
5
|
+
const linter_tags_1 = require("../linter-tags");
|
|
6
|
+
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
7
|
+
const range_1 = require("../../util/range");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const cell_order_1 = require("../../notebook/cell-order");
|
|
10
|
+
/**
|
|
11
|
+
* Flags a project whose scripts read what other scripts define, but which has no file that runs them in an order that
|
|
12
|
+
* works (a `main.R`, a makefile, `_targets.R`, or a package), and suggests a `main.R` that sources them in one.
|
|
13
|
+
* The files are the units here, as the cells of a notebook are for `notebook-cell-order`: a notebook counts as one file,
|
|
14
|
+
* and a file another file sources runs as part of it.
|
|
15
|
+
*/
|
|
16
|
+
exports.PROJECT_ENTRY_POINT = {
|
|
17
|
+
createSearch: () => flowr_search_builder_1.Q.from([]),
|
|
18
|
+
processSearchResult: async (_elements, _config, data) => {
|
|
19
|
+
const facts = await (0, cell_order_1.analyzeProject)(data);
|
|
20
|
+
const hard = facts.flatMap(f => f.needs.filter(n => !n.soft));
|
|
21
|
+
if (hard.length === 0 || (0, cell_order_1.projectEntry)(data) !== undefined) {
|
|
22
|
+
return { results: [], '.meta': {} };
|
|
23
|
+
}
|
|
24
|
+
const ast = await data.normalize();
|
|
25
|
+
const order = (0, cell_order_1.firstWorkingOrder)(facts);
|
|
26
|
+
/* the main.R goes into the root of the project, so it counts as its entry, and sources each file from there */
|
|
27
|
+
const context = data.inspectContext().files;
|
|
28
|
+
const root = context.root();
|
|
29
|
+
const path = (i) => context.relativePath(facts[i].cell.file ?? `${i + 1}`);
|
|
30
|
+
const files = (order ?? facts.map((_, i) => i)).map(path);
|
|
31
|
+
const entry = files.map(f => `source("${f}")`).join('\n') + '\n';
|
|
32
|
+
const reads = (0, cell_order_1.describeLinks)(facts, path);
|
|
33
|
+
/* the finding stands at the first read that fails in the loading order, else at the first read of another file */
|
|
34
|
+
const at = (0, cell_order_1.checkOrder)(facts, facts.map((_, i) => i)).flatMap(f => f.missing.filter(m => !m.soft))[0] ?? hard[0];
|
|
35
|
+
return { results: [{
|
|
36
|
+
certainty: order === undefined ? linter_format_1.LintingResultCertainty.Certain : linter_format_1.LintingResultCertainty.Uncertain,
|
|
37
|
+
involvedId: at.id,
|
|
38
|
+
loc: range_1.SourceLocation.fromNode(ast.idMap.get(at.id)),
|
|
39
|
+
files,
|
|
40
|
+
runs: order !== undefined,
|
|
41
|
+
reads,
|
|
42
|
+
entry,
|
|
43
|
+
quickFix: order === undefined ? undefined : [{
|
|
44
|
+
type: 'replace',
|
|
45
|
+
description: `Add a main.R that sources ${files.join(', ')}`,
|
|
46
|
+
loc: range_1.SourceLocation.from(range_1.SourceRange.from(1, 1, 1, 0), root === undefined ? 'main.R' : (0, path_1.join)(root, 'main.R')),
|
|
47
|
+
replacement: entry
|
|
48
|
+
}]
|
|
49
|
+
}], '.meta': {} };
|
|
50
|
+
},
|
|
51
|
+
prettyPrint: (0, linter_format_1.prettyPrintAt)(r => `${r.files.length} files`, r => r.runs
|
|
52
|
+
? `depend on each other (${r.reads.join('; ')}) in an unclear order: add a main.R that sources ${r.files.join(', ')}.`
|
|
53
|
+
: `depend on each other (${r.reads.join('; ')}) in a cycle, so no order of the files runs them all.`),
|
|
54
|
+
info: {
|
|
55
|
+
name: 'Project Entry Point',
|
|
56
|
+
tags: [linter_tags_1.LintingRuleTag.Reproducibility, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.QuickFix],
|
|
57
|
+
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
58
|
+
description: 'Finds projects whose scripts read what other scripts define but that have no entry file (such as a main.R, a makefile, or _targets.R) that runs them in an order that works, and suggests a main.R that sources them in one.',
|
|
59
|
+
defaultConfig: () => ({})
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=project-entry-point.js.map
|
|
@@ -43,6 +43,8 @@ export interface SuppressionCounts {
|
|
|
43
43
|
unresolvedLibrary: number;
|
|
44
44
|
/** declared by `utils::globalVariables()` or set by R's method dispatch (`.Generic`, `.Method`, `.Class`) */
|
|
45
45
|
declaredGlobal: number;
|
|
46
|
+
/** another cell of the notebook binds it, see the `notebook-cell-order` rule for whether it runs before */
|
|
47
|
+
notebookCell: number;
|
|
46
48
|
}
|
|
47
49
|
export interface UndefinedSymbolMetadata extends MergeableRecord {
|
|
48
50
|
totalFunctionCalls: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UNDEFINED_SYMBOL = void 0;
|
|
4
|
+
const cell_order_1 = require("../../notebook/cell-order");
|
|
4
5
|
const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
|
|
5
6
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
6
7
|
const graph_1 = require("../../dataflow/graph/graph");
|
|
@@ -96,7 +97,7 @@ exports.UNDEFINED_SYMBOL = {
|
|
|
96
97
|
const meta = {
|
|
97
98
|
totalFunctionCalls: 0,
|
|
98
99
|
totalVariableUses: 0,
|
|
99
|
-
suppressed: { installed: 0, loadedPackage: 0, enclosingScope: 0, nonStandardEval: 0, subscript: 0, unresolvedLibrary: 0, declaredGlobal: 0 }
|
|
100
|
+
suppressed: { installed: 0, loadedPackage: 0, enclosingScope: 0, nonStandardEval: 0, subscript: 0, unresolvedLibrary: 0, declaredGlobal: 0, notebookCell: 0 }
|
|
100
101
|
};
|
|
101
102
|
function suppress(reason) {
|
|
102
103
|
meta.suppressed[reason]++;
|
|
@@ -117,6 +118,7 @@ exports.UNDEFINED_SYMBOL = {
|
|
|
117
118
|
// names a package declares global (`utils::globalVariables`) are no undefined symbols to R CMD check either
|
|
118
119
|
const declaredGlobals = declaredGlobalVariables(graph, ctx);
|
|
119
120
|
const boundByAssign = assignedNames(graph, ctx);
|
|
121
|
+
const otherCellBinds = new Set((await (0, cell_order_1.analyzeNotebook)(data)).flatMap(f => f.needs.map(n => n.id)));
|
|
120
122
|
// scope-defined names, a fallback for closure variables flowR's dataflow did not statically link
|
|
121
123
|
const scopeDefined = (0, undefined_symbol_util_1.collectScopeDefinedNames)(graph);
|
|
122
124
|
// packages whose exports are in scope: DESCRIPTION/library() deps plus the default-attached base
|
|
@@ -145,6 +147,9 @@ exports.UNDEFINED_SYMBOL = {
|
|
|
145
147
|
|| (namespace === undefined ? isAttachedBaseName(name) : (0, r_base_packages_1.baseRExportOwner)(name) === namespace)) {
|
|
146
148
|
return undefined;
|
|
147
149
|
}
|
|
150
|
+
if (otherCellBinds.has(id)) {
|
|
151
|
+
return suppress('notebookCell');
|
|
152
|
+
}
|
|
148
153
|
// a bare name a test framework exports, used in a test file where that framework's namespace is attached
|
|
149
154
|
if (namespace === undefined && isImplicitTestExport(name, node.info.file)) {
|
|
150
155
|
return suppress('loadedPackage');
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataflowGraph } from '../dataflow/graph/graph';
|
|
2
|
+
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
+
import { type CellFacts } from './cell-order';
|
|
4
|
+
/**
|
|
5
|
+
* A cell graph is the dataflow graph of what the cells of a notebook read of each other: the vertices that read
|
|
6
|
+
* what another cell provides, the vertices of the other cells that provide it, and a reads edge from each read to them.
|
|
7
|
+
* Like a {@link CallGraph} it is a view of the dataflow graph, so whatever draws one draws the other.
|
|
8
|
+
*/
|
|
9
|
+
export type CellGraph = DataflowGraph;
|
|
10
|
+
/**
|
|
11
|
+
* Helper object for cell graphs, see {@link CellGraph}.
|
|
12
|
+
* @helper dataflow
|
|
13
|
+
*/
|
|
14
|
+
export declare const CellGraph: {
|
|
15
|
+
readonly name: "CellGraph";
|
|
16
|
+
/** The cell graph of the notebook whose cells have the `facts`, out of its whole dataflow `graph`. */
|
|
17
|
+
readonly compute: (this: void, graph: DataflowGraph, facts: readonly CellFacts[]) => CellGraph;
|
|
18
|
+
/** The vertices of `graph` boxed by the cell (or file) whose lines they stand in, `label` saying what to call each box. */
|
|
19
|
+
readonly groups: (this: void, graph: DataflowGraph, facts: readonly CellFacts[], label?: (cell: number) => string) => {
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly ids: ReadonlySet<NodeId>;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CellGraph = void 0;
|
|
4
|
+
const graph_1 = require("../dataflow/graph/graph");
|
|
5
|
+
const edge_1 = require("../dataflow/graph/edge");
|
|
6
|
+
const range_1 = require("../util/range");
|
|
7
|
+
const cell_order_1 = require("./cell-order");
|
|
8
|
+
/**
|
|
9
|
+
* Helper object for cell graphs, see {@link CellGraph}.
|
|
10
|
+
* @helper dataflow
|
|
11
|
+
*/
|
|
12
|
+
exports.CellGraph = {
|
|
13
|
+
name: 'CellGraph',
|
|
14
|
+
/** The cell graph of the notebook whose cells have the `facts`, out of its whole dataflow `graph`. */
|
|
15
|
+
compute(graph, facts) {
|
|
16
|
+
const result = new graph_1.DataflowGraph(graph.idMap);
|
|
17
|
+
const add = (id) => {
|
|
18
|
+
const vertex = graph.getVertex(id);
|
|
19
|
+
if (vertex !== undefined && !result.hasVertex(id)) {
|
|
20
|
+
result.addVertex(vertex, undefined, true);
|
|
21
|
+
}
|
|
22
|
+
return vertex !== undefined;
|
|
23
|
+
};
|
|
24
|
+
for (const f of facts) {
|
|
25
|
+
for (const need of f.needs.filter(n => add(n.id))) {
|
|
26
|
+
for (const e of need.providers.flatMap(p => facts[p].effects)) {
|
|
27
|
+
if ('binds' in e && e.id !== undefined && need.anyOf.some(s => (0, cell_order_1.binds)(e.binds, s)) && add(e.id)) {
|
|
28
|
+
result.addEdge(need.id, e.id, edge_1.EdgeType.Reads);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
},
|
|
35
|
+
/** The vertices of `graph` boxed by the cell (or file) whose lines they stand in, `label` saying what to call each box. */
|
|
36
|
+
groups(graph, facts, label = i => `cell ${i + 1}`) {
|
|
37
|
+
const ids = facts.map(() => new Set());
|
|
38
|
+
for (const id of graph.rootIds()) {
|
|
39
|
+
const node = graph.idMap?.get(id);
|
|
40
|
+
const line = range_1.SourceRange.getStartLine(node?.location);
|
|
41
|
+
/* the cells of a project are whole files, which all start at line 1 */
|
|
42
|
+
const cell = line === undefined ? -1 : facts.findIndex(f => (f.cell.file === undefined || f.cell.file === node?.info.file) && line >= f.cell.from && line <= f.cell.to);
|
|
43
|
+
ids[cell]?.add(id);
|
|
44
|
+
}
|
|
45
|
+
return facts.map((_, i) => ({ label: label(i), ids: ids[i] }));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=cell-graph.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CellFacts } from './cell-order';
|
|
2
|
+
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
3
|
+
/**
|
|
4
|
+
* The cells of a notebook as mermaid diagrams, see {@link https://mermaid.js.org}; `name` says what to call a cell.
|
|
5
|
+
* @helper output
|
|
6
|
+
*/
|
|
7
|
+
export declare const CellOrderMermaid: {
|
|
8
|
+
readonly name: "CellOrderMermaid";
|
|
9
|
+
/**
|
|
10
|
+
* The {@link CellGraph} of the notebook, its vertices boxed by cell: each read of what another cell provides with a reads edge
|
|
11
|
+
* to where that cell binds it, the reads failing top to bottom marked.
|
|
12
|
+
*/
|
|
13
|
+
readonly graph: (this: void, facts: readonly CellFacts[], dataflow: DataflowGraph, label?: (cell: number) => string) => string;
|
|
14
|
+
/** the working orders as a tree of the cells they run first, an order that cannot run all cells ends in a stuck leaf */
|
|
15
|
+
readonly orders: (this: void, facts: readonly CellFacts[], name?: (cell: number) => string, limit?: number) => string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CellOrderMermaid = void 0;
|
|
4
|
+
const cell_order_1 = require("./cell-order");
|
|
5
|
+
const cell_graph_1 = require("./cell-graph");
|
|
6
|
+
const dfg_1 = require("../util/mermaid/dfg");
|
|
7
|
+
const mermaid_1 = require("../util/mermaid/mermaid");
|
|
8
|
+
const MaxShownOrders = 64;
|
|
9
|
+
/** a node label in mermaid's markdown strings, the form flowR's other graphs use as well */
|
|
10
|
+
const label = (title, detail) => `"\`${mermaid_1.Mermaid.escape(title)}${detail === undefined ? '' : `\n*${mermaid_1.Mermaid.escape(detail)}*`}\`"`;
|
|
11
|
+
/**
|
|
12
|
+
* The cells of a notebook as mermaid diagrams, see {@link https://mermaid.js.org}; `name` says what to call a cell.
|
|
13
|
+
* @helper output
|
|
14
|
+
*/
|
|
15
|
+
exports.CellOrderMermaid = {
|
|
16
|
+
name: 'CellOrderMermaid',
|
|
17
|
+
/**
|
|
18
|
+
* The {@link CellGraph} of the notebook, its vertices boxed by cell: each read of what another cell provides with a reads edge
|
|
19
|
+
* to where that cell binds it, the reads failing top to bottom marked.
|
|
20
|
+
*/
|
|
21
|
+
graph(facts, dataflow, label = i => `cell ${i + 1}`) {
|
|
22
|
+
const graph = cell_graph_1.CellGraph.compute(dataflow, facts);
|
|
23
|
+
const mark = new Set((0, cell_order_1.checkOrder)(facts, facts.map((_, i) => i)).flatMap(f => f.missing.filter(m => !m.soft).map(m => m.id)));
|
|
24
|
+
/* the reads point up to what they read, so the first cell to run stands on top */
|
|
25
|
+
return dfg_1.DataflowMermaid.convert({ graph, prefix: 'flowchart BT', includeEnvironments: false, simplified: true, mark, groups: cell_graph_1.CellGraph.groups(graph, facts, label) }).string;
|
|
26
|
+
},
|
|
27
|
+
/** the working orders as a tree of the cells they run first, an order that cannot run all cells ends in a stuck leaf */
|
|
28
|
+
orders(facts, name = i => `cell ${i + 1}`, limit = MaxShownOrders) {
|
|
29
|
+
const orders = (0, cell_order_1.workingOrders)(facts).take(limit + 1).toArray();
|
|
30
|
+
const lines = ['flowchart LR', ' root@{ shape: f-circ }'];
|
|
31
|
+
const known = new Set();
|
|
32
|
+
for (const order of orders.slice(0, limit)) {
|
|
33
|
+
let parent = 'root';
|
|
34
|
+
for (const [depth, cell] of order.entries()) {
|
|
35
|
+
const id = `o${order.slice(0, depth + 1).join('_')}`;
|
|
36
|
+
if (!known.has(id)) {
|
|
37
|
+
known.add(id);
|
|
38
|
+
lines.push(` ${id}[${label(name(cell))}]`, ` ${parent} --> ${id}`);
|
|
39
|
+
}
|
|
40
|
+
parent = id;
|
|
41
|
+
}
|
|
42
|
+
const left = facts.length - order.length;
|
|
43
|
+
lines.push(left === 0 ? ` style ${parent} stroke:#009e73,stroke-width:3px` : ` ${parent} --> ${parent}_stuck([${label(`stuck, ${left} cell${left === 1 ? '' : 's'} cannot run`)}])`);
|
|
44
|
+
}
|
|
45
|
+
if (orders.length > limit) {
|
|
46
|
+
lines.push(` more([${label('and more orders')}])`, ' root -.-> more');
|
|
47
|
+
}
|
|
48
|
+
return lines.join('\n');
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=cell-order-mermaid.js.map
|