@eagleoutice/flowr 2.16.5 → 2.16.7
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 +21 -15
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +2 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +3 -1
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -7
- package/abstract-interpretation/data-frame/resolve-args.js +2 -11
- package/cli/repl/commands/repl-cfg.js +5 -19
- package/cli/repl/commands/repl-code-command.d.ts +10 -0
- package/cli/repl/commands/repl-code-command.js +18 -0
- package/cli/repl/commands/repl-dataflow.js +34 -59
- package/cli/repl/commands/repl-normalize.js +24 -41
- package/cli/repl/commands/repl-query.js +10 -17
- package/config.js +3 -3
- package/control-flow/cfg-dead-code.js +15 -2
- package/control-flow/useless-loop.js +1 -2
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/dataflow/environments/ambient-state-name.d.ts +80 -0
- package/dataflow/environments/ambient-state-name.js +113 -0
- package/dataflow/environments/built-in-eval-name.d.ts +3 -1
- package/dataflow/environments/built-in-eval-name.js +2 -0
- package/dataflow/environments/built-in-props.d.ts +27 -7
- package/dataflow/environments/built-in-props.js +59 -44
- package/dataflow/environments/built-in.d.ts +5 -2
- package/dataflow/environments/built-in.js +22 -5
- package/dataflow/environments/default-builtin-config.d.ts +538 -14
- package/dataflow/environments/default-builtin-config.js +189 -123
- package/dataflow/environments/environment.d.ts +7 -1
- package/dataflow/environments/environment.js +19 -1
- package/dataflow/environments/identifier.d.ts +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +13 -3
- package/dataflow/eval/resolve/alias-tracking.js +66 -37
- package/dataflow/eval/resolve/resolve-argument.d.ts +4 -2
- package/dataflow/eval/resolve/resolve-argument.js +23 -11
- package/dataflow/eval/resolve/resolve.d.ts +5 -0
- package/dataflow/eval/resolve/resolve.js +25 -3
- package/dataflow/eval/values/r-value.d.ts +4 -2
- package/dataflow/eval/values/r-value.js +3 -1
- package/dataflow/eval/values/string/string-constants.d.ts +7 -1
- package/dataflow/eval/values/string/string-constants.js +38 -36
- package/dataflow/extractor.js +105 -2
- package/dataflow/fn/argument-roles.js +22 -8
- package/dataflow/fn/function-semantics.d.ts +3 -2
- package/dataflow/fn/strict-function.js +13 -2
- package/dataflow/graph/df-helper.d.ts +14 -1
- package/dataflow/graph/df-helper.js +37 -4
- package/dataflow/graph/graph.d.ts +6 -0
- package/dataflow/graph/graph.js +6 -0
- package/dataflow/internal/linker.d.ts +4 -1
- package/dataflow/internal/linker.js +11 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +88 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +19 -44
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +125 -158
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +35 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +10 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +21 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +11 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +6 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +42 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +11 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +29 -4
- package/dataflow/internal/process/functions/call/common.js +3 -4
- package/dataflow/internal/process/functions/call/deferred.d.ts +3 -2
- package/dataflow/internal/process/functions/call/deferred.js +17 -9
- package/dataflow/internal/process/functions/call/quoted.js +1 -1
- package/documentation/doc-capabilities.js +3 -2
- package/documentation/doc-readme.js +1 -2
- package/documentation/doc-util/doc-dfg.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +3 -1
- package/documentation/doc-util/doc-query.js +4 -4
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-linter.js +16 -206
- package/documentation/wiki-linting-and-testing.js +31 -64
- package/documentation/wiki-query.js +41 -0
- package/index.d.ts +1 -0
- package/index.js +5 -1
- package/linter/linter-format.d.ts +6 -0
- package/linter/linter-format.js +10 -0
- package/linter/linter-rules.d.ts +155 -103
- package/linter/linter-rules.js +2 -0
- package/linter/linter-util.d.ts +23 -0
- package/linter/linter-util.js +58 -0
- package/linter/rules/absolute-path.d.ts +2 -2
- package/linter/rules/absolute-path.js +1 -4
- package/linter/rules/cmd-check/bogus-return.d.ts +2 -2
- package/linter/rules/cmd-check/bogus-return.js +3 -7
- package/linter/rules/cmd-check/call-arguments.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.js +3 -7
- package/linter/rules/cmd-check/cmd-check-util.d.ts +8 -9
- package/linter/rules/cmd-check/cmd-check-util.js +14 -26
- package/linter/rules/cmd-check/compiled-code.d.ts +8 -3
- package/linter/rules/cmd-check/compiled-code.js +3 -13
- package/linter/rules/cmd-check/dependency-declaration.d.ts +2 -2
- package/linter/rules/cmd-check/dependency-declaration.js +6 -7
- package/linter/rules/cmd-check/description-metadata.d.ts +4 -4
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +2 -2
- package/linter/rules/cmd-check/documentation-mismatch.js +4 -11
- package/linter/rules/cmd-check/file-checks.d.ts +19 -6
- package/linter/rules/cmd-check/file-checks.js +13 -5
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.js +3 -2
- package/linter/rules/cmd-check/namespace-tampering.d.ts +2 -2
- package/linter/rules/cmd-check/namespace-tampering.js +9 -9
- package/linter/rules/cmd-check/non-ascii-code.d.ts +2 -2
- package/linter/rules/cmd-check/package-data.d.ts +11 -5
- package/linter/rules/cmd-check/package-data.js +5 -12
- package/linter/rules/cmd-check/package-files.js +4 -10
- package/linter/rules/cmd-check/package-hooks.d.ts +2 -2
- package/linter/rules/cmd-check/package-hooks.js +10 -8
- package/linter/rules/cmd-check/package-metafiles.d.ts +8 -3
- package/linter/rules/cmd-check/package-metafiles.js +3 -12
- package/linter/rules/cmd-check/package-runtime.d.ts +18 -5
- package/linter/rules/cmd-check/package-runtime.js +64 -20
- package/linter/rules/cmd-check/package-structure.d.ts +11 -5
- package/linter/rules/cmd-check/package-structure.js +4 -12
- package/linter/rules/cmd-check/rd-files.d.ts +8 -3
- package/linter/rules/cmd-check/rd-files.js +4 -14
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +2 -2
- package/linter/rules/cmd-check/s-three-method-consistency.js +3 -4
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +5 -8
- package/linter/rules/dead-code.d.ts +5 -4
- package/linter/rules/dead-code.js +25 -14
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/deprecated-functions.js +16 -23
- package/linter/rules/file-path-validity.d.ts +2 -2
- package/linter/rules/file-path-validity.js +3 -6
- package/linter/rules/function-finder-util.d.ts +3 -3
- package/linter/rules/function-finder-util.js +7 -14
- package/linter/rules/namespace-access.d.ts +2 -2
- package/linter/rules/namespace-access.js +6 -9
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +1 -4
- package/linter/rules/network-functions.d.ts +3 -3
- package/linter/rules/no-leaked-credentials.d.ts +2 -2
- package/linter/rules/no-leaked-credentials.js +1 -4
- package/linter/rules/overwritten-file.d.ts +38 -0
- package/linter/rules/overwritten-file.js +102 -0
- package/linter/rules/problematic-inputs.d.ts +16 -6
- package/linter/rules/problematic-inputs.js +78 -34
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +1 -4
- package/linter/rules/seeded-randomness.d.ts +3 -3
- package/linter/rules/seeded-randomness.js +6 -23
- package/linter/rules/software-has-license.d.ts +2 -2
- package/linter/rules/software-has-license.js +1 -4
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +1 -4
- package/linter/rules/stop-with-call-arg.d.ts +2 -2
- package/linter/rules/stop-with-call-arg.js +4 -11
- package/linter/rules/syntactically-valid.d.ts +4 -2
- package/linter/rules/syntactically-valid.js +29 -10
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +1 -4
- package/linter/rules/undefined-symbol.d.ts +2 -2
- package/linter/rules/undefined-symbol.js +25 -22
- package/linter/rules/unescaped-arguments.d.ts +2 -2
- package/linter/rules/unescaped-arguments.js +1 -4
- package/linter/rules/unused-definition.d.ts +2 -2
- package/linter/rules/unused-definition.js +37 -25
- package/linter/rules/unused-import.d.ts +2 -2
- package/linter/rules/unused-import.js +9 -14
- package/linter/rules/useless-loop.d.ts +7 -6
- package/linter/rules/useless-loop.js +4 -8
- package/package.json +5 -3
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +15 -11
- package/project/context/flowr-analyzer-files-context.d.ts +3 -0
- package/project/context/flowr-analyzer-files-context.js +6 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +6 -1
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +35 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +2 -1
- package/project/plugins/file-plugins/files/flowr-rsession-file.d.ts +26 -0
- package/project/plugins/file-plugins/files/flowr-rsession-file.js +44 -0
- package/project/plugins/file-plugins/files/r-session.d.ts +20 -0
- package/project/plugins/file-plugins/files/r-session.js +58 -0
- package/project/plugins/file-plugins/files/recorded-runs.d.ts +18 -0
- package/project/plugins/file-plugins/files/recorded-runs.js +8 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.js +28 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/project/sigdb/spec-query.d.ts +73 -0
- package/project/sigdb/spec-query.js +339 -0
- package/queries/base-query-format.d.ts +1 -1
- package/queries/base-query-format.js +2 -2
- package/queries/catalog/absint-query/absint-query-executor.js +3 -6
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +113 -73
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +2 -3
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -3
- package/queries/catalog/config-query/config-query-format.d.ts +0 -1
- package/queries/catalog/config-query/config-query-format.js +1 -2
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -4
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +0 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -2
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -3
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +7 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +72 -42
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +24 -6
- package/queries/catalog/dependencies-query/dependencies-query-format.js +108 -3
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +6 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +6 -6
- package/queries/catalog/dependencies-query/function-info/write-functions.js +13 -7
- package/queries/catalog/dependencies-query/implicit-echo.js +21 -7
- package/queries/catalog/dice-query/dice-query-executor.js +2 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -3
- package/queries/catalog/files-query/files-query-executor.js +2 -3
- package/queries/catalog/function-info-query/function-info-query-executor.js +2 -1
- package/queries/catalog/function-info-query/function-info-query-format.d.ts +0 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +1 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +3 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +0 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -3
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +0 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -2
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -3
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +0 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -2
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +3 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +60 -13
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +2 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -9
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +8 -33
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +8 -31
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +0 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +0 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -5
- package/queries/catalog/origin-query/origin-query-executor.js +3 -11
- package/queries/catalog/project-query/project-query-executor.js +23 -7
- package/queries/catalog/project-query/project-query-format.d.ts +5 -0
- package/queries/catalog/project-query/project-query-format.js +20 -2
- package/queries/catalog/provenance-query/provenance-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +0 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -2
- package/queries/catalog/search-query/search-query-executor.js +2 -3
- package/queries/catalog/signature-query/signature-query-executor.js +39 -0
- package/queries/catalog/signature-query/signature-query-format.d.ts +7 -1
- package/queries/catalog/signature-query/signature-query-format.js +15 -1
- package/queries/catalog/signature-query/signature-query-render.js +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -3
- package/queries/query-function-property.d.ts +28 -0
- package/queries/query-function-property.js +48 -0
- package/queries/query-meta.d.ts +3 -0
- package/queries/query-meta.js +8 -0
- package/queries/query.d.ts +13 -18
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -3
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +9 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.d.ts +8 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.js +49 -0
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/type.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +4 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.js +1 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +1 -1
- package/reconstruct/reconstruct.js +35 -1
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/static/fingerprint.js +7 -3
- package/slicing/static/removal-slice.js +4 -2
- package/slicing/static/static-slicer.js +6 -0
- package/util/assert.js +2 -2
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +11 -0
- package/util/collections/defaultmap.d.ts +5 -1
- package/util/collections/defaultmap.js +6 -1
- package/util/files.js +26 -5
- package/util/flowr-version.d.ts +10 -0
- package/util/flowr-version.js +20 -0
- package/util/glob.js +6 -4
- package/util/r-regex.d.ts +6 -0
- package/util/r-regex.js +17 -0
- package/util/text/args.d.ts +5 -0
- package/util/text/args.js +28 -22
- package/util/text/name-rank.d.ts +2 -0
- package/util/text/name-rank.js +3 -1
- package/util/text/regex.d.ts +10 -0
- package/util/text/regex.js +29 -0
- package/util/version.d.ts +1 -6
- package/util/version.js +6 -14
- package/documentation/doc-util/doc-functions.d.ts +0 -24
- package/documentation/doc-util/doc-functions.js +0 -65
|
@@ -4,6 +4,7 @@ import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing
|
|
|
4
4
|
import { type REnvironmentInformation } from '../../../../../environments/environment';
|
|
5
5
|
import type { FlowrAnalyzerContext } from '../../../../../../project/context/flowr-analyzer-context';
|
|
6
6
|
import type { IdentifierReference } from '../../../../../environments/identifier';
|
|
7
|
+
import type { DataflowInformation } from '../../../../../info';
|
|
7
8
|
/**
|
|
8
9
|
* Computes, for every function-definition vertex `F`, `summary(F) = own(F)` unioned with `summary(G)` over every transitive callee `G`.
|
|
9
10
|
* @param graph - the fully linked dataflow graph
|
|
@@ -20,6 +21,16 @@ export declare function computeCallGraphSummaries<T>(this: void, graph: Dataflow
|
|
|
20
21
|
export declare function linkMaterializedExportsToLoaders(graph: DataflowGraph, environment: REnvironmentInformation): void;
|
|
21
22
|
/** Re-resolves still-open reads whose name is one of the transitively escaped `<<-` definitions in `escapedNames`, adding {@link EdgeType.Reads} edges. */
|
|
22
23
|
export declare function reResolveOpenReferences(this: void, graph: DataflowGraph, environment: REnvironmentInformation, references: readonly IdentifierReference[], escapedNames: ReadonlySet<string>): void;
|
|
24
|
+
/**
|
|
25
|
+
* The global state each function may leave changed when it is called, as the names of the pseudo variables it changes
|
|
26
|
+
* (see {@link AmbientStateName}): `#option:digits` for `options(digits = 3)`, `#env:PATH` for `Sys.setenv(PATH = "")`, or `#sink`.
|
|
27
|
+
* A function reports what its callees report as well, so with `a01 <- function() options(digits = 3)` and `a22 <- function() a01()`,
|
|
28
|
+
* both set `#option:digits`. What a function only changes within its own frame (`withr::local_options`) is left out.
|
|
29
|
+
* @param info - the dataflow information of the whole program
|
|
30
|
+
* @returns per function-definition vertex the state it may change, which is empty for a function changing none
|
|
31
|
+
* @useInstead {@link Dataflow.sideEffects.ambientWrites}
|
|
32
|
+
*/
|
|
33
|
+
export declare function ambientWritesOfFunctions(this: void, info: Pick<DataflowInformation, 'graph' | 'environment'>): Map<NodeId, ReadonlySet<string>>;
|
|
23
34
|
/**
|
|
24
35
|
* Propagates every function's escaped side effects (attached packages and `<<-` definitions) to its transitive callers.
|
|
25
36
|
* @returns the enriched top-level environment and whether it grew (so the extractor can re-link and re-run to a fixpoint).
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.computeCallGraphSummaries = computeCallGraphSummaries;
|
|
4
4
|
exports.linkMaterializedExportsToLoaders = linkMaterializedExportsToLoaders;
|
|
5
5
|
exports.reResolveOpenReferences = reResolveOpenReferences;
|
|
6
|
+
exports.ambientWritesOfFunctions = ambientWritesOfFunctions;
|
|
6
7
|
exports.propagateTransitiveSideEffects = propagateTransitiveSideEffects;
|
|
7
8
|
const edge_1 = require("../../../../../graph/edge");
|
|
8
9
|
const node_id_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
@@ -17,6 +18,7 @@ const identifier_1 = require("../../../../../environments/identifier");
|
|
|
17
18
|
const built_in_ambient_state_1 = require("./built-in-ambient-state");
|
|
18
19
|
const defaultmap_1 = require("../../../../../../util/collections/defaultmap");
|
|
19
20
|
const df_helper_1 = require("../../../../../graph/df-helper");
|
|
21
|
+
const ambient_state_name_1 = require("../../../../../environments/ambient-state-name");
|
|
20
22
|
/**
|
|
21
23
|
* Computes, for every function-definition vertex `F`, `summary(F) = own(F)` unioned with `summary(G)` over every transitive callee `G`.
|
|
22
24
|
* @param graph - the fully linked dataflow graph
|
|
@@ -53,14 +55,17 @@ function linkMaterializedExportsToLoaders(graph, environment) {
|
|
|
53
55
|
/* the attached namespaces hold every export of every package, far more than the graph ever materializes, so the
|
|
54
56
|
* cheap direction is to ask the graph first: an export earns an edge only if it is a vertex or the target of a
|
|
55
57
|
* `calls` edge. Both are read off the graph once here instead of per export binding. */
|
|
56
|
-
const called = new Set(graph.vertices(true).map(([id]) => id));
|
|
58
|
+
const called = new Set(graph.vertices(true).map(([id]) => id).filter(node_id_1.NodeId.isBuiltIn));
|
|
57
59
|
for (const [, outgoing] of graph.edges()) {
|
|
58
60
|
for (const [target, edge] of outgoing) {
|
|
59
|
-
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Calls)) {
|
|
61
|
+
if (node_id_1.NodeId.isBuiltIn(target) && edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Calls)) {
|
|
60
62
|
called.add(target);
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
}
|
|
66
|
+
if (called.size === 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
64
69
|
/* export node id -> its loading `library()`/`use()` call, from the final environment */
|
|
65
70
|
const loaders = new Map();
|
|
66
71
|
for (const e of environment_1.REnvironment.frames(environment.current)) {
|
|
@@ -194,6 +199,12 @@ function propagateTransitivePackages(graph, environment, ctx) {
|
|
|
194
199
|
}
|
|
195
200
|
/** The ambient writes of body calls only linking resolved to a built-in (see {@link writesOfHiddenBuiltIn}), linking their reads as well. */
|
|
196
201
|
function hiddenBuiltInWrites(graph, environment) {
|
|
202
|
+
const { writes, reads } = hiddenBuiltInAccess(graph, environment);
|
|
203
|
+
linkHiddenReads(graph, reads);
|
|
204
|
+
return writes;
|
|
205
|
+
}
|
|
206
|
+
/** The ambient writes and reads of body calls only linking resolved to a built-in, per call. */
|
|
207
|
+
function hiddenBuiltInAccess(graph, environment) {
|
|
197
208
|
const builtIns = environment_1.REnvironment.findBuiltIn(environment.current);
|
|
198
209
|
const writes = new Map();
|
|
199
210
|
const reads = new Map();
|
|
@@ -218,8 +229,7 @@ function hiddenBuiltInWrites(graph, environment) {
|
|
|
218
229
|
}
|
|
219
230
|
}
|
|
220
231
|
}
|
|
221
|
-
|
|
222
|
-
return writes;
|
|
232
|
+
return { writes, reads };
|
|
223
233
|
}
|
|
224
234
|
/** A hidden call reads the state where the functions running it are called. */
|
|
225
235
|
function linkHiddenReads(graph, reads) {
|
|
@@ -336,6 +346,21 @@ function reResolveOpenReferences(graph, environment, references, escapedNames) {
|
|
|
336
346
|
}
|
|
337
347
|
}
|
|
338
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* The global state each function may leave changed when it is called, as the names of the pseudo variables it changes
|
|
351
|
+
* (see {@link AmbientStateName}): `#option:digits` for `options(digits = 3)`, `#env:PATH` for `Sys.setenv(PATH = "")`, or `#sink`.
|
|
352
|
+
* A function reports what its callees report as well, so with `a01 <- function() options(digits = 3)` and `a22 <- function() a01()`,
|
|
353
|
+
* both set `#option:digits`. What a function only changes within its own frame (`withr::local_options`) is left out.
|
|
354
|
+
* @param info - the dataflow information of the whole program
|
|
355
|
+
* @returns per function-definition vertex the state it may change, which is empty for a function changing none
|
|
356
|
+
* @useInstead {@link Dataflow.sideEffects.ambientWrites}
|
|
357
|
+
*/
|
|
358
|
+
function ambientWritesOfFunctions(info) {
|
|
359
|
+
const hidden = hiddenBuiltInAccess(info.graph, info.environment).writes;
|
|
360
|
+
const names = escapedDefinitionMap(info.graph, hidden);
|
|
361
|
+
const summary = computeCallGraphSummaries(info.graph, escapedDefinitions(hidden));
|
|
362
|
+
return new Map(summary.entries().map(([id, definitions]) => [id, new Set(definitions.values().flatMap(d => names.get(d) ?? []).map(d => d.name).filter(ambient_state_name_1.AmbientStateName.is))]));
|
|
363
|
+
}
|
|
339
364
|
/**
|
|
340
365
|
* Propagates every function's escaped side effects (attached packages and `<<-` definitions) to its transitive callers.
|
|
341
366
|
* @returns the enriched top-level environment and whether it grew (so the extractor can re-link and re-run to a fixpoint).
|
|
@@ -16,7 +16,7 @@ const processor_1 = require("../../../../processor");
|
|
|
16
16
|
const model_1 = require("../../../../../r-bridge/lang-4.x/ast/model/model");
|
|
17
17
|
const r_function_call_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
18
18
|
const identifier_1 = require("../../../../environments/identifier");
|
|
19
|
-
const
|
|
19
|
+
const ambient_state_name_1 = require("../../../../environments/ambient-state-name");
|
|
20
20
|
const resolve_by_name_1 = require("../../../../environments/resolve-by-name");
|
|
21
21
|
const process_argument_1 = require("../process-argument");
|
|
22
22
|
const vertex_1 = require("../../../../graph/vertex");
|
|
@@ -40,9 +40,8 @@ function forceVertexArgumentValueReferences(rootId, value, graph, env) {
|
|
|
40
40
|
graph.addEdge(rootId, exit.nodeId, edge_1.EdgeType.Reads);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
const containedSubflowIn = graph.verticesOfType(vertex_1.VertexType.FunctionDefinition).flatMap(([, info]) => info.subflow.in);
|
|
44
43
|
/* try to resolve them against the current environment */
|
|
45
|
-
for (const ref of
|
|
44
|
+
for (const ref of value.in) {
|
|
46
45
|
for (const resolved of ref.name ? (0, resolve_by_name_1.resolveByName)(ref.name, env, ref.type) ?? [] : []) {
|
|
47
46
|
graph.addEdge(ref.nodeId, resolved.nodeId, edge_1.EdgeType.Reads);
|
|
48
47
|
}
|
|
@@ -124,7 +123,7 @@ function processAllArguments({ functionName, args, data, finalGraph, functionRoo
|
|
|
124
123
|
/* a data argument holds a value, so a function of that name is not what it reads; the narrowed type stays on the reference */
|
|
125
124
|
const ingoing = nonFunction?.has(inId) ? { ...original, type: identifier_1.ReferenceType.NonFunction } : original;
|
|
126
125
|
/* a call reading the options or graphics state (`#...`, see AmbientStateName) reads a variable, not itself */
|
|
127
|
-
const refType =
|
|
126
|
+
const refType = ambient_state_name_1.AmbientStateName.is(ingoing.name) ? identifier_1.ReferenceType.Variable
|
|
128
127
|
: vertex_2.DfgVertex.isFunctionCall(finalGraph.getVertex(inId)) ? identifier_1.ReferenceType.Function
|
|
129
128
|
: ingoing.type === identifier_1.ReferenceType.NonFunction ? identifier_1.ReferenceType.NonFunction : identifier_1.ReferenceType.Unknown;
|
|
130
129
|
const tryToResolve = ingoing.name ? (0, resolve_by_name_1.resolveByName)(ingoing.name, data.environment, refType) : undefined;
|
|
@@ -50,7 +50,8 @@ export declare const Deferred: {
|
|
|
50
50
|
/**
|
|
51
51
|
* Links the expression rooted at `expr` to the bindings it may meet when it is evaluated. Given the reads
|
|
52
52
|
* that may force it, control flow rules out what no force can reach; without them every binding stays a
|
|
53
|
-
* candidate.
|
|
53
|
+
* candidate. An argument (`inCallerFrame`) is evaluated in the frame of its call, so the parameters and local
|
|
54
|
+
* bindings of the function forcing it are none it can meet, even though they come before the force.
|
|
54
55
|
*/
|
|
55
|
-
readonly link: <Info>(this: void, graph: DataflowGraph, expr: NodeId, index: NameIndex, idMap: AstIdMap<Info & ParentInformation>, forces?: ForceSites) => void;
|
|
56
|
+
readonly link: <Info>(this: void, graph: DataflowGraph, expr: NodeId, index: NameIndex, idMap: AstIdMap<Info & ParentInformation>, forces?: ForceSites, inCallerFrame?: boolean) => void;
|
|
56
57
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Deferred = void 0;
|
|
4
4
|
exports.verticesByName = verticesByName;
|
|
5
|
-
const r_string_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
6
5
|
const model_1 = require("../../../../../r-bridge/lang-4.x/ast/model/model");
|
|
7
6
|
const r_function_call_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
7
|
const node_id_1 = require("../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
@@ -18,7 +17,7 @@ const df_helper_1 = require("../../../../graph/df-helper");
|
|
|
18
17
|
/** The vertices of `type` by their unquoted name. */
|
|
19
18
|
function verticesByName(graph, type, idMap) {
|
|
20
19
|
const named = graph.vertexIdsOfType(type).filter(id => node_id_1.NodeId.recoverName(id, idMap) !== undefined);
|
|
21
|
-
return Map.groupBy(named, id =>
|
|
20
|
+
return Map.groupBy(named, id => node_id_1.NodeId.recoverBareName(id, idMap));
|
|
22
21
|
}
|
|
23
22
|
/** The names a deferred expression touches, each with the node touching it and whether it is written. */
|
|
24
23
|
function namesWithin(expr, graph, idMap) {
|
|
@@ -35,9 +34,9 @@ function namesWithin(expr, graph, idMap) {
|
|
|
35
34
|
if (vertex_1.DfgVertex.isFunctionCall(graph.getVertex(inner.info.id))) {
|
|
36
35
|
names.push([inner.info.id, identifier_1.Identifier.getName(inner.functionName.content), false]);
|
|
37
36
|
for (const def of df_helper_1.Dataflow.sourcesOf(graph, inner.info.id, edge_1.EdgeType.SideEffectOnCall)) {
|
|
38
|
-
const name = node_id_1.NodeId.
|
|
37
|
+
const name = node_id_1.NodeId.recoverBareName(def, idMap);
|
|
39
38
|
if (name !== undefined) {
|
|
40
|
-
names.push([def,
|
|
39
|
+
names.push([def, name, true]);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -122,9 +121,10 @@ exports.Deferred = {
|
|
|
122
121
|
/**
|
|
123
122
|
* Links the expression rooted at `expr` to the bindings it may meet when it is evaluated. Given the reads
|
|
124
123
|
* that may force it, control flow rules out what no force can reach; without them every binding stays a
|
|
125
|
-
* candidate.
|
|
124
|
+
* candidate. An argument (`inCallerFrame`) is evaluated in the frame of its call, so the parameters and local
|
|
125
|
+
* bindings of the function forcing it are none it can meet, even though they come before the force.
|
|
126
126
|
*/
|
|
127
|
-
link(graph, expr, index, idMap, forces) {
|
|
127
|
+
link(graph, expr, index, idMap, forces, inCallerFrame = false) {
|
|
128
128
|
const within = namesWithin(expr, graph, idMap);
|
|
129
129
|
const own = new Set(within.map(([id]) => id));
|
|
130
130
|
/* one walk per direction answers every candidate, so the sets are built once and only when asked for */
|
|
@@ -147,8 +147,8 @@ exports.Deferred = {
|
|
|
147
147
|
reach.always.set(use, always);
|
|
148
148
|
return always;
|
|
149
149
|
};
|
|
150
|
-
/* `delayedAssign` names its variable with a string literal
|
|
151
|
-
const bindingName = forces === undefined ? undefined :
|
|
150
|
+
/* `delayedAssign` names its variable with a string literal */
|
|
151
|
+
const bindingName = forces === undefined ? undefined : node_id_1.NodeId.recoverBareName(forces.binding, idMap) ?? '';
|
|
152
152
|
for (const [node, name, writes] of within) {
|
|
153
153
|
if (writes) {
|
|
154
154
|
/* a write of the bound name replaces the binding, so a read it definitely reaches sees only it */
|
|
@@ -168,7 +168,7 @@ exports.Deferred = {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
|
-
const seen = (index.definitions.get(name) ?? []).filter(seenByAForce);
|
|
171
|
+
const seen = (index.definitions.get(name) ?? []).filter(d => seenByAForce(d) && (!inCallerFrame || visibleFrom(expr, d, graph, idMap)));
|
|
172
172
|
for (const definition of seen) {
|
|
173
173
|
graph.addEdge(node, definition, edge_1.EdgeType.Reads);
|
|
174
174
|
}
|
|
@@ -180,4 +180,12 @@ exports.Deferred = {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
+
/** Whether the binding `definition` lives in a frame `expr` sees: not a parameter or a local binding of a function `expr` is not within. */
|
|
184
|
+
function visibleFrom(expr, definition, graph, idMap) {
|
|
185
|
+
const node = idMap.get(definition);
|
|
186
|
+
const parent = node?.info.parent === undefined ? undefined : idMap.get(node.info.parent);
|
|
187
|
+
const local = node?.info.role === "param-n" /* RoleInParent.ParameterName */ || vertex_1.DfgVertex.hasOrigin(graph.getVertex(parent?.info.id ?? ''), built_in_proc_name_1.BuiltInProcName.Assignment);
|
|
188
|
+
const frame = local ? model_1.RNode.findEnclosing(definition, idMap, r_function_definition_1.RFunctionDefinition.is) : undefined;
|
|
189
|
+
return frame === undefined || model_1.RNode.findEnclosing(expr, idMap, n => n.info.id === frame) !== undefined;
|
|
190
|
+
}
|
|
183
191
|
//# sourceMappingURL=deferred.js.map
|
|
@@ -165,7 +165,7 @@ exports.Quoted = {
|
|
|
165
165
|
const forces = forcesOf(graph, parameter, flow, forcing, reachOf);
|
|
166
166
|
if (forces !== undefined && !linkedWith.get(argument).has(forces)) {
|
|
167
167
|
linkedWith.get(argument).add(forces);
|
|
168
|
-
deferred_1.Deferred.link(graph, argument, index, idMap, forces);
|
|
168
|
+
deferred_1.Deferred.link(graph, argument, index, idMap, forces, true);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.capabilitiesAsHtml = capabilitiesAsHtml;
|
|
7
|
+
const args_1 = require("../util/text/args");
|
|
7
8
|
const data_1 = require("../r-bridge/data/data");
|
|
8
9
|
const fs_1 = __importDefault(require("fs"));
|
|
9
10
|
const child_process_1 = require("child_process");
|
|
@@ -32,9 +33,9 @@ function claimedCapabilities(array) {
|
|
|
32
33
|
}
|
|
33
34
|
return (0, arrays_1.uniqueArray)(ids);
|
|
34
35
|
}
|
|
35
|
-
/** a test name as the source spells it, with its escapes (`\\name`) resolved */
|
|
36
|
+
/** a test name as the source spells it, with its escapes (`\\name`) resolved and kept on one line */
|
|
36
37
|
function unescapeSource(name) {
|
|
37
|
-
return name.replace(
|
|
38
|
+
return (0, args_1.unescapeArg)(name).replace(/[\n\r\t]/g, ' ');
|
|
38
39
|
}
|
|
39
40
|
/** the capabilities a `// \@signature <ids>` comment on the line of `index` or the line above names */
|
|
40
41
|
function pinnedCapabilities(content, index) {
|
|
@@ -52,9 +52,9 @@ async function printDfGraphForCode(parser, code, { callGraph = false, simplified
|
|
|
52
52
|
if (switchCodeAndGraph) {
|
|
53
53
|
(0, assert_1.guard)(showCode, 'can not switch code and graph if code is not shown');
|
|
54
54
|
}
|
|
55
|
-
const sigDbNote = `No ${ctx ? ctx.linkPage('wiki/Signature Database', 'signature database') : `[signature database](${doc_files_1.FlowrWikiBaseRef}/Signature-Database)`} is mounted
|
|
55
|
+
const sigDbNote = `No ${ctx ? ctx.linkPage('wiki/Signature Database', 'signature database') : `[signature database](${doc_files_1.FlowrWikiBaseRef}/Signature-Database)`} is mounted, so \`library()\` attaches no exports (base-R names are still qualified, e.g., \`stats::acf\`).`;
|
|
56
56
|
const took = timeless ? '' : (0, doc_timings_1.docTook)(duration);
|
|
57
|
-
const metaInfo = `The analysis${took} ran (
|
|
57
|
+
const metaInfo = `The analysis${took} ran (parse and normalize with the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) in the generation environment. ${sigDbNote}`;
|
|
58
58
|
const graph = callGraph ? call_graph_1.CallGraph.compute(result.dataflow.graph) : result.dataflow.graph;
|
|
59
59
|
const dfGraph = printDfGraph(graph, mark, simplified);
|
|
60
60
|
const simplyText = simplified ? '(simplified) ' : '';
|
|
@@ -10,6 +10,8 @@ export interface ShowQueryOptions {
|
|
|
10
10
|
readonly showCode?: boolean;
|
|
11
11
|
readonly collapseResult?: boolean;
|
|
12
12
|
readonly collapseQuery?: boolean;
|
|
13
|
+
/** whether to add the detailed JSON results besides the prettified ones (default: true) */
|
|
14
|
+
readonly withJson?: boolean;
|
|
13
15
|
readonly shorthand?: string;
|
|
14
16
|
readonly ctx?: GeneralDocContext;
|
|
15
17
|
/** additional in-memory files registered before the request, e.g. the targets of `source(...)` calls; a `code` of `file://<name>` analyzes one of them */
|
|
@@ -23,7 +25,7 @@ export interface ShowQueryOptions {
|
|
|
23
25
|
/**
|
|
24
26
|
* Visualizes a query and its results in markdown format.
|
|
25
27
|
*/
|
|
26
|
-
export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, shorthand, ctx, files, prepare }?: ShowQueryOptions): Promise<string>;
|
|
28
|
+
export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, withJson, shorthand, ctx, files, prepare }?: ShowQueryOptions): Promise<string>;
|
|
27
29
|
export interface QueryDocumentation {
|
|
28
30
|
/** only for virtual queries, active ones carry their {@link SupportedQuery.title} */
|
|
29
31
|
readonly name?: string;
|
|
@@ -34,7 +34,7 @@ const QueryDocFile = 'src/documentation/wiki-query.ts';
|
|
|
34
34
|
/**
|
|
35
35
|
* Visualizes a query and its results in markdown format.
|
|
36
36
|
*/
|
|
37
|
-
async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, shorthand, ctx, files, prepare } = {}) {
|
|
37
|
+
async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, withJson = true, shorthand, ctx, files, prepare } = {}) {
|
|
38
38
|
const now = performance.now();
|
|
39
39
|
const builder = new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setParser(parser);
|
|
40
40
|
prepare?.(builder);
|
|
@@ -69,16 +69,16 @@ _Results (prettified and summarized):_
|
|
|
69
69
|
|
|
70
70
|
${await (0, query_print_1.asciiSummaryOfQueryResult)(ansi_1.markdownFormatter, duration, results, analyzer, queries)}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
${withJson ? `<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
73
73
|
|
|
74
74
|
${metaInfo}
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
Please consult the ${ctx ? ctx.linkPage('wiki/Interface', 'Interface') : `[Interface](${doc_files_1.FlowrWikiBaseRef}/Interface)`} wiki page for more information on how to get those.
|
|
76
|
+
The JSON contains the ids of the nodes in question (see the ${ctx ? ctx.linkPage('wiki/Interface', 'Interface') : `[Interface](${doc_files_1.FlowrWikiBaseRef}/Interface)`} wiki page).
|
|
78
77
|
|
|
79
78
|
${(0, doc_code_1.jsonWithLimit)(results)}
|
|
80
79
|
|
|
81
80
|
</details>
|
|
81
|
+
` : ''}
|
|
82
82
|
|
|
83
83
|
${showCode ? `
|
|
84
84
|
<details> <summary style="color:gray">Original Code</summary>
|
|
@@ -86,7 +86,7 @@ After registering the rule, add its entry to ${ctx.link('LintingRuleExamples')}:
|
|
|
86
86
|
|
|
87
87
|
New linting rules should be covered by tests following the existing linter test pattern. The test file should be named \`lint-<my-new-rule>.test.ts\`. Existing linter tests can be used as references for the expected structure.
|
|
88
88
|
|
|
89
|
-
The
|
|
89
|
+
The wiki page of the rule shows only its example from ${ctx.link('LintingRuleExamples')} and links the test file, so adding tests leaves the wiki unchanged.
|
|
90
90
|
For general information on creating and regenerating wiki pages, see ${ctx.linkPage('wiki/FAQ')}, especially the FAQ entry on creating new wiki pages. The linter overview and the generated rule documentation can then be inspected through ${ctx.linkPage('wiki/Linter')}.
|
|
91
91
|
`;
|
|
92
92
|
}
|