@eagleoutice/flowr 2.16.2 โ 2.16.3
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 +10 -10
- package/abstract-interpretation/data-frame/arguments.js +4 -3
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
- package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
- package/abstract-interpretation/data-frame/semantics.js +2 -6
- package/benchmark/slicer.js +1 -3
- package/benchmark/summarizer/first-phase/input.js +1 -12
- package/benchmark/summarizer/second-phase/process.d.ts +7 -0
- package/benchmark/summarizer/second-phase/process.js +15 -12
- package/cli/repl/commands/repl-cfg.js +18 -49
- package/cli/repl/commands/repl-clipboard.d.ts +2 -0
- package/cli/repl/commands/repl-clipboard.js +5 -0
- package/cli/repl/commands/repl-commands.js +2 -2
- package/cli/repl/commands/repl-dataflow.js +21 -55
- package/cli/repl/commands/repl-normalize.js +15 -28
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +10 -10
- package/cli/repl/commands/repl-signature.js +4 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +8 -30
- package/cli/repl/server/messages/message-analysis.js +1 -1
- package/config.d.ts +6 -0
- package/config.js +7 -4
- package/control-flow/cfg-dead-code.js +5 -14
- package/control-flow/cfg-to-basic-blocks.js +1 -6
- package/control-flow/control-flow-graph.d.ts +2 -16
- package/control-flow/control-flow-graph.js +8 -66
- package/control-flow/diff-cfg.js +10 -23
- package/control-flow/semantic-cfg-guided-visitor.js +5 -11
- package/control-flow/simple-visitor.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +138 -138
- package/data/r-base-packages.generated.js +0 -1
- package/data/r-base-primitives.generated.js +0 -1
- package/data/r-s3-generics.generated.d.ts +5 -0
- package/data/r-s3-generics.generated.js +103 -0
- package/dataflow/cluster.js +2 -1
- package/dataflow/environments/append.d.ts +1 -0
- package/dataflow/environments/built-in-props.d.ts +10 -0
- package/dataflow/environments/built-in-props.js +25 -1
- package/dataflow/environments/built-in.js +15 -9
- package/dataflow/environments/clone.d.ts +1 -0
- package/dataflow/environments/clone.js +1 -0
- package/dataflow/environments/default-builtin-config.d.ts +188 -14
- package/dataflow/environments/default-builtin-config.js +125 -65
- package/dataflow/environments/define.d.ts +1 -0
- package/dataflow/environments/define.js +1 -0
- package/dataflow/environments/environment.d.ts +27 -0
- package/dataflow/environments/environment.js +37 -16
- package/dataflow/environments/frame-memory.d.ts +9 -1
- package/dataflow/environments/frame-memory.js +12 -1
- package/dataflow/environments/identifier.d.ts +0 -2
- package/dataflow/environments/identifier.js +5 -7
- package/dataflow/environments/overwrite.js +1 -0
- package/dataflow/environments/query-fn-props.js +2 -3
- package/dataflow/environments/scoping.d.ts +3 -0
- package/dataflow/environments/scoping.js +3 -0
- package/dataflow/eval/resolve/alias-tracking.js +3 -3
- package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
- package/dataflow/eval/resolve/resolve-argument.js +16 -11
- package/dataflow/eval/resolve/resolve-numbers.js +5 -2
- package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
- package/dataflow/eval/resolve/resolve.js +1 -2
- package/dataflow/eval/values/intervals/interval-constants.js +1 -6
- package/dataflow/eval/values/r-value.js +1 -6
- package/dataflow/extractor.js +17 -17
- package/dataflow/fn/argument-roles.js +15 -15
- package/dataflow/fn/class-declaration.js +7 -7
- package/dataflow/fn/frame-reflection.d.ts +1 -23
- package/dataflow/fn/frame-reflection.js +8 -95
- package/dataflow/fn/function-props.d.ts +0 -3
- package/dataflow/fn/function-props.js +9 -11
- package/dataflow/fn/function-semantics.d.ts +1 -0
- package/dataflow/fn/strict-function.js +15 -14
- package/dataflow/graph/call-graph.d.ts +8 -0
- package/dataflow/graph/call-graph.js +40 -25
- package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
- package/dataflow/graph/dataflowgraph-builder.js +15 -135
- package/dataflow/graph/df-helper.d.ts +56 -4
- package/dataflow/graph/df-helper.js +116 -1
- package/dataflow/graph/diff-dataflow-graph.js +13 -15
- package/dataflow/graph/graph-helper.d.ts +20 -0
- package/dataflow/graph/graph-helper.js +18 -0
- package/dataflow/graph/graph.js +3 -8
- package/dataflow/graph/match-args.d.ts +1 -1
- package/dataflow/graph/match-args.js +3 -3
- package/dataflow/internal/linker.d.ts +4 -10
- package/dataflow/internal/linker.js +21 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +6 -7
- package/dataflow/internal/process/functions/call/deferred.js +8 -8
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
- package/dataflow/internal/process/functions/call/named-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/nse.js +4 -4
- package/dataflow/internal/process/functions/call/quoted.js +16 -14
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/internal/process/process-named-call.js +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
- package/documentation/data/faq/wiki-faq-store.js +2 -2
- package/documentation/doc-capabilities.js +2 -1
- package/documentation/doc-util/doc-functions.js +2 -2
- package/documentation/doc-util/doc-repl.js +4 -4
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-cfg.js +2 -1
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-interface.js +3 -2
- package/documentation/wiki-linter.js +54 -4
- package/documentation/wiki-mk/doc-maker.js +1 -2
- package/documentation/wiki-query.js +25 -0
- package/documentation/wiki-search.js +2 -1
- package/documentation/wiki-signature-database.js +0 -2
- package/linter/linter-executor.js +4 -0
- package/linter/linter-rules.d.ts +518 -1
- package/linter/linter-rules.js +39 -1
- package/linter/linter-tags.d.ts +6 -0
- package/linter/linter-tags.js +6 -0
- package/linter/rules/absolute-path.js +4 -3
- package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
- package/linter/rules/cmd-check/bogus-return.js +63 -0
- package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
- package/linter/rules/cmd-check/call-arguments.js +211 -0
- package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
- package/linter/rules/cmd-check/class-string-comparison.js +135 -0
- package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
- package/linter/rules/cmd-check/cmd-check-util.js +169 -0
- package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
- package/linter/rules/cmd-check/compiled-code.js +350 -0
- package/linter/rules/cmd-check/conformance.d.ts +47 -0
- package/linter/rules/cmd-check/conformance.js +166 -0
- package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
- package/linter/rules/cmd-check/dependency-declaration.js +299 -0
- package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
- package/linter/rules/cmd-check/description-metadata.js +393 -0
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +54 -0
- package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
- package/linter/rules/cmd-check/file-checks.d.ts +29 -0
- package/linter/rules/cmd-check/file-checks.js +34 -0
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
- package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
- package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
- package/linter/rules/cmd-check/global-environment-modification.js +237 -0
- package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
- package/linter/rules/cmd-check/namespace-tampering.js +162 -0
- package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
- package/linter/rules/cmd-check/non-ascii-code.js +112 -0
- package/linter/rules/cmd-check/package-code.d.ts +30 -0
- package/linter/rules/cmd-check/package-code.js +141 -0
- package/linter/rules/cmd-check/package-data.d.ts +49 -0
- package/linter/rules/cmd-check/package-data.js +181 -0
- package/linter/rules/cmd-check/package-files.d.ts +41 -0
- package/linter/rules/cmd-check/package-files.js +157 -0
- package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
- package/linter/rules/cmd-check/package-hooks.js +165 -0
- package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
- package/linter/rules/cmd-check/package-metafiles.js +292 -0
- package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
- package/linter/rules/cmd-check/package-runtime.js +284 -0
- package/linter/rules/cmd-check/package-structure.d.ts +85 -0
- package/linter/rules/cmd-check/package-structure.js +320 -0
- package/linter/rules/cmd-check/rd-files.d.ts +67 -0
- package/linter/rules/cmd-check/rd-files.js +621 -0
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
- package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
- package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
- package/linter/rules/deprecated-functions.js +4 -4
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -14
- package/linter/rules/no-leaked-credentials.js +4 -4
- package/linter/rules/problematic-inputs.js +2 -1
- package/linter/rules/seeded-randomness.js +5 -5
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-license.js +1 -1
- package/linter/rules/unclosed-connection.js +3 -3
- package/linter/rules/undefined-symbol-util.js +16 -32
- package/linter/rules/undefined-symbol.d.ts +2 -0
- package/linter/rules/undefined-symbol.js +33 -3
- package/linter/rules/unescaped-arguments.js +10 -9
- package/linter/rules/unused-definition.js +13 -19
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.js +1 -1
- package/project/context/flowr-analyzer-environment-context.d.ts +1 -1
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +3 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
- package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
- package/project/context/flowr-file.d.ts +4 -0
- package/project/context/flowr-file.js +4 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
- package/project/sigdb/build.js +16 -30
- package/project/sigdb/dict.d.ts +4 -6
- package/project/sigdb/dict.js +125 -31
- package/project/sigdb/reader.js +2 -18
- package/project/sigdb/sigdb-download.js +14 -23
- package/queries/base-query-format.d.ts +2 -0
- package/queries/base-query-format.js +10 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
- package/queries/catalog/absint-query/absint-query-format.js +5 -7
- package/queries/catalog/call-context-query/call-context-query-executor.js +24 -32
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
- package/queries/catalog/config-query/config-query-format.js +3 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
- package/queries/catalog/dependencies-query/data-flow.d.ts +43 -0
- package/queries/catalog/dependencies-query/data-flow.js +173 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
- package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
- package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
- package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
- package/queries/catalog/dependencies-query/implicit-echo.js +33 -34
- package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
- package/queries/catalog/dependencies-query/link-devices.js +9 -6
- package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
- package/queries/catalog/dependencies-query/plot-description.js +119 -0
- package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
- package/queries/catalog/dependencies-query/plot-objects.js +61 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
- package/queries/catalog/dice-query/dice-query-format.js +3 -40
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-executor.js +10 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
- package/queries/catalog/linter-query/linter-query-format.js +32 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.js +4 -5
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
- package/queries/catalog/search-query/search-query-format.js +1 -3
- package/queries/catalog/signature-query/signature-query-executor.js +3 -3
- package/queries/catalog/signature-query/signature-query-format.js +2 -2
- package/queries/catalog/slice-query-options.d.ts +16 -0
- package/queries/catalog/slice-query-options.js +28 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
- package/queries/query-print.d.ts +4 -0
- package/queries/query-print.js +17 -1
- package/queries/query.d.ts +3 -3
- package/queries/query.js +3 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
- package/r-bridge/lang-4.x/ast/model/model.js +28 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
- package/r-bridge/retriever.d.ts +0 -4
- package/r-bridge/retriever.js +0 -13
- package/r-bridge/roxygen2/documentation-provider.js +3 -7
- package/r-bridge/shell.js +3 -8
- package/reconstruct/auto-select/magic-comments.js +8 -7
- package/reconstruct/inline/source-inline-map.d.ts +3 -0
- package/reconstruct/inline/source-inline-map.js +8 -7
- package/reconstruct/reconstruct.d.ts +1 -1
- package/reconstruct/reconstruct.js +33 -109
- package/search/flowr-search-printer.js +4 -15
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/filters/all-variables.js +1 -2
- package/slicing/static/fingerprint.js +11 -2
- package/slicing/static/slice-call.d.ts +2 -8
- package/slicing/static/slice-call.js +8 -18
- package/slicing/static/static-slicer.js +81 -6
- package/util/collections/arrays.js +1 -1
- package/util/collections/set.js +1 -1
- package/util/diff-graph.d.ts +4 -0
- package/util/diff-graph.js +12 -0
- package/util/files.js +2 -6
- package/util/json.js +1 -15
- package/util/mermaid/cfg.js +10 -17
- package/util/mermaid/dfg.js +6 -8
- package/util/objects.d.ts +1 -1
- package/util/quads.js +4 -13
- package/util/r-author.js +5 -5
- package/util/range.d.ts +9 -0
- package/util/range.js +11 -0
- package/util/schema.js +3 -3
- package/util/simple-df/dfg-view.js +2 -1
- package/util/text/ansi.js +1 -2
- package/util/text/playground-link.js +2 -1
- package/util/text/r-highlight.js +2 -1
- package/util/text/strings.d.ts +2 -0
- package/util/text/strings.js +5 -0
- package/util/text/time.js +1 -2
- package/util/version.js +4 -3
- package/dataflow/fn/recursive-function.d.ts +0 -6
- package/dataflow/fn/recursive-function.js +0 -32
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processFunctionParameter = processFunctionParameter;
|
|
4
4
|
const processor_1 = require("../../../processor");
|
|
5
5
|
const identifier_1 = require("../../../environments/identifier");
|
|
6
|
-
const define_1 = require("../../../environments/define");
|
|
7
6
|
const edge_1 = require("../../../graph/edge");
|
|
8
7
|
const control_flow_1 = require("../../control-flow");
|
|
9
8
|
const logic_1 = require("../../../../util/logic");
|
|
10
9
|
const r_function_definition_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
10
|
+
const environment_1 = require("../../../environments/environment");
|
|
11
11
|
function definedByDefault(parameter, defaultValue) {
|
|
12
12
|
if (defaultValue === undefined) {
|
|
13
13
|
return [];
|
|
@@ -34,7 +34,7 @@ function processFunctionParameter(parameter, data) {
|
|
|
34
34
|
for (const reference of name.unknownReferences) {
|
|
35
35
|
const written = { ...reference, type: identifier_1.ReferenceType.Parameter, definedAt: parameter.info.id };
|
|
36
36
|
graph.setDefinitionOfVertex(written, defaultValue === undefined ? [] : [defaultValue.entryPoint]);
|
|
37
|
-
environment =
|
|
37
|
+
environment = environment_1.REnvironment.define(written, false, environment);
|
|
38
38
|
for (const node of definedBy) {
|
|
39
39
|
graph.addEdge(written.nodeId, node, edge_1.EdgeType.DefinedBy);
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@ function isChainNode(node) {
|
|
|
42
42
|
function chainLhsRaw(node) {
|
|
43
43
|
if (r_function_call_1.RFunctionCall.is(node)) {
|
|
44
44
|
const arg = node.arguments[0];
|
|
45
|
-
return r_argument_1.RArgument.
|
|
45
|
+
return r_argument_1.RArgument.valueOf(arg);
|
|
46
46
|
}
|
|
47
47
|
return r_argument_1.RArgument.is(node.lhs) ? node.lhs.value : node.lhs;
|
|
48
48
|
}
|
|
@@ -4,9 +4,9 @@ exports.getOriginInDfg = getOriginInDfg;
|
|
|
4
4
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
5
5
|
const vertex_1 = require("../graph/vertex");
|
|
6
6
|
const edge_1 = require("../graph/edge");
|
|
7
|
-
const linker_1 = require("../internal/linker");
|
|
8
7
|
const assert_1 = require("../../util/assert");
|
|
9
8
|
const vertex_2 = require("../graph/vertex");
|
|
9
|
+
const df_helper_1 = require("../graph/df-helper");
|
|
10
10
|
/**
|
|
11
11
|
* Obtain the (dataflow) origin of a given node in the dfg.
|
|
12
12
|
* @useInstead {@link Dataflow.origin}
|
|
@@ -112,7 +112,7 @@ function getCallTarget(dfg, call) {
|
|
|
112
112
|
id: call.id,
|
|
113
113
|
proc: o
|
|
114
114
|
})) : undefined;
|
|
115
|
-
const targets = new Set(
|
|
115
|
+
const targets = new Set(df_helper_1.Dataflow.callTargetsOf(call.id, dfg));
|
|
116
116
|
if (targets.size === 0) {
|
|
117
117
|
// resolve via variable use origin
|
|
118
118
|
return origins?.length === 0 ? getVariableUseOrigin(dfg, call) : origins;
|
|
@@ -14,6 +14,7 @@ import type { DataflowGraph } from '../graph/graph';
|
|
|
14
14
|
* @param graph - Dataflow Graph
|
|
15
15
|
* @param nodeId - NodeId of Symbol to resolve
|
|
16
16
|
* @returns List including the Definitions and References to that definition
|
|
17
|
+
* @useInstead {@link Dataflow.refsToSymbol}
|
|
17
18
|
* @example getAllRefsToSymbol('3\@y') returns ['3\@y', '4\@y']
|
|
18
19
|
*/
|
|
19
20
|
export declare function getAllRefsToSymbol(graph: DataflowGraph, nodeId: NodeId): NodeId[] | undefined;
|
|
@@ -18,6 +18,7 @@ const df_helper_1 = require("../graph/df-helper");
|
|
|
18
18
|
* @param graph - Dataflow Graph
|
|
19
19
|
* @param nodeId - NodeId of Symbol to resolve
|
|
20
20
|
* @returns List including the Definitions and References to that definition
|
|
21
|
+
* @useInstead {@link Dataflow.refsToSymbol}
|
|
21
22
|
* @example getAllRefsToSymbol('3\@y') returns ['3\@y', '4\@y']
|
|
22
23
|
*/
|
|
23
24
|
function getAllRefsToSymbol(graph, nodeId) {
|
|
@@ -34,14 +35,8 @@ function getAllRefsToSymbol(graph, nodeId) {
|
|
|
34
35
|
const res = new Set();
|
|
35
36
|
for (const { id } of definitiveOrigins) {
|
|
36
37
|
res.add(id);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads))
|
|
40
|
-
.forEach(([node, _]) => res.add(node));
|
|
41
|
-
graph.outgoingEdges(id)
|
|
42
|
-
?.entries()
|
|
43
|
-
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedByOnCall))
|
|
44
|
-
.forEach(([node, _]) => res.add(node));
|
|
38
|
+
df_helper_1.Dataflow.sourcesOf(graph, id, edge_1.EdgeType.Reads).forEach(node => res.add(node));
|
|
39
|
+
df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.DefinedByOnCall).forEach(node => res.add(node));
|
|
45
40
|
}
|
|
46
41
|
return [...res];
|
|
47
42
|
}
|
|
@@ -4,6 +4,7 @@ exports.FaqStore = void 0;
|
|
|
4
4
|
const doc_structure_1 = require("../../doc-util/doc-structure");
|
|
5
5
|
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
6
6
|
const assert_1 = require("../../../util/assert");
|
|
7
|
+
const strings_1 = require("../../../util/text/strings");
|
|
7
8
|
const FlowrFaqTopics = {
|
|
8
9
|
'flowr.use': 'โจ Using <i>flowR</i>',
|
|
9
10
|
'flowr.development': '๐งโ๐ป <i>flowR</i> Development',
|
|
@@ -33,8 +34,7 @@ class FaqStore {
|
|
|
33
34
|
}
|
|
34
35
|
printAllTopics(topicsRegex) {
|
|
35
36
|
const topics = Array.from(this.faqs.keys())
|
|
36
|
-
.filter(topic => topicsRegex.test(topic))
|
|
37
|
-
.sort((a, b) => a.localeCompare(b));
|
|
37
|
+
.filter(topic => topicsRegex.test(topic)).sort(strings_1.compareByCodeUnit);
|
|
38
38
|
let output = '';
|
|
39
39
|
for (const topic of topics) {
|
|
40
40
|
const faqs = this.faqs.get(topic).sort(([q1], [q2]) => q1.localeCompare(q2));
|
|
@@ -14,6 +14,7 @@ const playground_link_1 = require("../util/text/playground-link");
|
|
|
14
14
|
const operators_1 = require("../r-bridge/lang-4.x/ast/model/operators");
|
|
15
15
|
const r_highlight_1 = require("../util/text/r-highlight");
|
|
16
16
|
const defaultmap_1 = require("../util/collections/defaultmap");
|
|
17
|
+
const arrays_1 = require("../util/collections/arrays");
|
|
17
18
|
const testSuites = Object.values(summary_def_1.TestSuites);
|
|
18
19
|
const maxSignatureTests = 3;
|
|
19
20
|
const preferredContext = 'dataflow';
|
|
@@ -29,7 +30,7 @@ function claimedCapabilities(array) {
|
|
|
29
30
|
for (const [, , operator] of array.matchAll(operatorSpreadRegex)) {
|
|
30
31
|
ids.push(...operators_1.OperatorDatabase[operator]?.capabilities ?? []);
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return (0, arrays_1.uniqueArray)(ids);
|
|
33
34
|
}
|
|
34
35
|
/** a test name as the source spells it, with its escapes (`\\name`) resolved */
|
|
35
36
|
function unescapeSource(name) {
|
|
@@ -9,7 +9,7 @@ const assert_1 = require("../../util/assert");
|
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const doc_types_1 = require("./doc-types");
|
|
12
|
-
function
|
|
12
|
+
function collectFunctionHierarchy(sourceFiles, options, fname) {
|
|
13
13
|
const hierarchyList = [];
|
|
14
14
|
const visit = (node, sourceFile) => {
|
|
15
15
|
if (!node) {
|
|
@@ -56,7 +56,7 @@ function getFunctionsFromFolder(options) {
|
|
|
56
56
|
const { files, program } = (0, doc_types_1.getTypeScriptSourceFiles)(fileNames);
|
|
57
57
|
(0, assert_1.guard)(files.length > 0, () => `No source files found for ${JSON.stringify(fileNames)}`);
|
|
58
58
|
const withProgram = { ...options, program };
|
|
59
|
-
const hierarchyList =
|
|
59
|
+
const hierarchyList = collectFunctionHierarchy(files, withProgram, options.fname);
|
|
60
60
|
return {
|
|
61
61
|
info: hierarchyList,
|
|
62
62
|
program
|
|
@@ -12,7 +12,7 @@ const prompt_1 = require("../../cli/repl/prompt");
|
|
|
12
12
|
const doc_code_1 = require("./doc-code");
|
|
13
13
|
const print_version_1 = require("../../cli/repl/print-version");
|
|
14
14
|
const flowr_analyzer_builder_1 = require("../../project/flowr-analyzer-builder");
|
|
15
|
-
function
|
|
15
|
+
function scriptHelpMarkdown(script, starredVersion) {
|
|
16
16
|
let base = `| **${(0, doc_cli_option_1.getReplCommand)(script[0], false, starredVersion !== undefined)}** | ${script[1].description}`;
|
|
17
17
|
if (starredVersion) {
|
|
18
18
|
base += ` (star: ${starredVersion.description})`;
|
|
@@ -34,7 +34,7 @@ function printReplHelpAsMarkdownTable() {
|
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
36
|
const starred = cmds[c[0] + '*'];
|
|
37
|
-
scriptHelp.push(
|
|
37
|
+
scriptHelp.push(scriptHelpMarkdown(c, starred));
|
|
38
38
|
}
|
|
39
39
|
return `
|
|
40
40
|
| Command | Description |
|
|
@@ -42,9 +42,9 @@ function printReplHelpAsMarkdownTable() {
|
|
|
42
42
|
${scriptHelp.sort().join('\n')}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
|
+
const AnsiEscapeCodes = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[mK]`, 'g');
|
|
45
46
|
function dropAnsiEscapeCodesAndCodeTags(input) {
|
|
46
|
-
|
|
47
|
-
return input.replace(/\x1B\[[0-9;]*[mK]/g, '')
|
|
47
|
+
return input.replace(AnsiEscapeCodes, '')
|
|
48
48
|
.replace(/<\/?code>/g, '')
|
|
49
49
|
.replace(/\**([^*]+)\**/g, '$1')
|
|
50
50
|
.replace(/_([^_]+)_/g, '$1');
|
|
@@ -222,7 +222,7 @@ function heritageTypeNames(node, sourceFile) {
|
|
|
222
222
|
function genericNames(node, sourceFile) {
|
|
223
223
|
return node.typeParameters?.map(param => param.getText(sourceFile) ?? '') ?? [];
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function collectTypeHierarchy(sourceFiles, options) {
|
|
226
226
|
const hierarchyList = [];
|
|
227
227
|
const typeChecker = options.program.getTypeChecker();
|
|
228
228
|
const visit = (node, sourceFile) => {
|
|
@@ -452,7 +452,7 @@ function getTypesFromFileAsMermaid(fileNames, options) {
|
|
|
452
452
|
const { files, program } = getTypeScriptSourceFiles(fileNames);
|
|
453
453
|
(0, assert_1.guard)(files.length > 0, () => `No source files found for ${JSON.stringify(fileNames)}`);
|
|
454
454
|
const withProgram = { ...options, program };
|
|
455
|
-
const hierarchyList =
|
|
455
|
+
const hierarchyList = collectTypeHierarchy(files, withProgram);
|
|
456
456
|
return {
|
|
457
457
|
mermaid: visualizeMermaidClassDiagram(hierarchyList, withProgram),
|
|
458
458
|
info: hierarchyList,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WikiAbsint = exports.IntervalAnalysis = exports.IntervalSemantics = void 0;
|
|
4
|
+
const range_1 = require("../util/range");
|
|
4
5
|
const absint_inference_1 = require("../abstract-interpretation/absint-inference");
|
|
5
6
|
const abstract_domain_1 = require("../abstract-interpretation/domains/abstract-domain");
|
|
6
7
|
const bounded_set_domain_1 = require("../abstract-interpretation/domains/bounded-set-domain");
|
|
@@ -69,7 +70,7 @@ async function inferIntervals() {
|
|
|
69
70
|
}
|
|
70
71
|
function nodeIdToSlicingCriterion(id, idMap) {
|
|
71
72
|
const node = idMap.get(id);
|
|
72
|
-
return `${node?.location
|
|
73
|
+
return `${range_1.SourceRange.getStartLine(node?.location)}@${node?.lexeme}`;
|
|
73
74
|
}
|
|
74
75
|
function multiValueExample() {
|
|
75
76
|
const domain = {
|
|
@@ -17,6 +17,7 @@ const cfg_properties_1 = require("../control-flow/cfg-properties");
|
|
|
17
17
|
const basic_cfg_guided_visitor_1 = require("../control-flow/basic-cfg-guided-visitor");
|
|
18
18
|
const syntax_cfg_guided_visitor_1 = require("../control-flow/syntax-cfg-guided-visitor");
|
|
19
19
|
const diff_cfg_1 = require("../control-flow/diff-cfg");
|
|
20
|
+
const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
20
21
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
21
22
|
const dfg_cfg_guided_visitor_1 = require("../control-flow/dfg-cfg-guided-visitor");
|
|
22
23
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
@@ -536,7 +537,7 @@ so the vertex of an expression *is* its exit point ‐ there are no separate
|
|
|
536
537
|
${(0, doc_structure_1.details)('Example: Where an if joins again', await (async function () {
|
|
537
538
|
const expr = 'if(u) 3 else 2';
|
|
538
539
|
const cfg = await (0, doc_cfg_1.getCfg)(shell, expr);
|
|
539
|
-
const [ifVertexId, ifVertex] = [...cfg.info.graph.vertices()].filter(([n]) => cfg.ast.idMap
|
|
540
|
+
const [ifVertexId, ifVertex] = [...cfg.info.graph.vertices()].filter(([n]) => node_id_1.NodeId.recoverName(n, cfg.ast.idMap) === 'if')[0];
|
|
540
541
|
(0, assert_1.guard)(control_flow_graph_1.CfgVertex.isStatement(ifVertex) || control_flow_graph_1.CfgVertex.isExpression(ifVertex));
|
|
541
542
|
return `${await (0, doc_cfg_1.printCfgCode)(shell, expr, { showCode: true, prefix: 'flowchart LR\n', ctx })}
|
|
542
543
|
|
|
@@ -17,7 +17,7 @@ function lintingRuleInfoFields(ctx) {
|
|
|
17
17
|
}).join('\n');
|
|
18
18
|
}
|
|
19
19
|
function defineRule() {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- rule objects are named in upper snake case, as the text below says
|
|
21
21
|
const MY_NEW_RULE = {
|
|
22
22
|
createSearch: (_config) => flowr_search_builder_1.Q.all(),
|
|
23
23
|
processSearchResult: (_elements, _config, _data) => ({
|
|
@@ -27,7 +27,6 @@ const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
|
27
27
|
const identifier_1 = require("../dataflow/environments/identifier");
|
|
28
28
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
29
29
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
30
|
-
const linker_1 = require("../dataflow/internal/linker");
|
|
31
30
|
const apply_kill_1 = require("../dataflow/environments/apply-kill");
|
|
32
31
|
const doc_normalized_ast_1 = require("./doc-util/doc-normalized-ast");
|
|
33
32
|
const identify_link_to_last_call_relation_1 = require("../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
@@ -49,6 +48,7 @@ const match_args_1 = require("../dataflow/graph/match-args");
|
|
|
49
48
|
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
50
49
|
const vertex_2 = require("../dataflow/graph/vertex");
|
|
51
50
|
const objects_1 = require("../util/objects");
|
|
51
|
+
const strings_1 = require("../util/text/strings");
|
|
52
52
|
async function subExplanation(parser, ctx, { description, code, expectedSubgraph }) {
|
|
53
53
|
expectedSubgraph = await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
|
|
54
54
|
const marks = [];
|
|
@@ -344,8 +344,8 @@ For starters, let's have a look at the environment of the call to \`<-\` in the
|
|
|
344
344
|
${(0, doc_env_1.printEnvironmentToMarkdown)(env.current)}
|
|
345
345
|
|
|
346
346
|
Great, you should see a definition of \`<-\` which is constraint by the [control dependency](#branches) to the \`if\`.
|
|
347
|
-
Hence, trying to re-resolve the call using ${ctx.link(
|
|
348
|
-
the following target ids: { \`${[...
|
|
347
|
+
Hence, trying to re-resolve the call using ${ctx.link(df_helper_1.Dataflow.callTargetsOf)} (defined in ${(0, doc_files_1.getFilePathMd)('../dataflow/internal/linker.ts')}) with the id \`${id}\` of the call as starting point will present you with
|
|
348
|
+
the following target ids: { \`${[...df_helper_1.Dataflow.callTargetsOf(id, info.dataflow.graph)].join('`, `')}\` }.
|
|
349
349
|
This way we know that the call may refer to the built-in assignment operator or to the multiplication.
|
|
350
350
|
Similarly, trying to resolve the name with ${ctx.link(resolve_helper_1.Resolve.byNameAndType)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
|
|
351
351
|
{ \`${resolve_helper_1.Resolve.byName(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
|
|
@@ -356,7 +356,7 @@ Similarly, trying to resolve the name with ${ctx.link(resolve_helper_1.Resolve.b
|
|
|
356
356
|
`)}
|
|
357
357
|
|
|
358
358
|
|
|
359
|
-
Similar to finding the definitions read by a variable use, please use the ${ctx.link(
|
|
359
|
+
Similar to finding the definitions read by a variable use, please use the ${ctx.link(df_helper_1.Dataflow.callTargetsOf)} function to find all possible definitions of a function call,
|
|
360
360
|
as explained in the ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')} section.`
|
|
361
361
|
})}
|
|
362
362
|
|
|
@@ -538,7 +538,7 @@ ${(0, doc_structure_1.block)({
|
|
|
538
538
|
content: `
|
|
539
539
|
A ${linkEdgeName(edge_1.EdgeType.Reads)} edge is not a transitive closure and only links the "directly read" definition(s).
|
|
540
540
|
Our abstract domains resolving transitive ${linkEdgeName(edge_1.EdgeType.Reads)} edges (and for that matter, following ${linkEdgeName(edge_1.EdgeType.Returns)} as well)
|
|
541
|
-
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(
|
|
541
|
+
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(df_helper_1.Dataflow.callTargetsOf)},
|
|
542
542
|
as well as ${ctx.link(resolve_helper_1.Resolve.toBuiltIn)} which do this for specific cases.
|
|
543
543
|
Refer to ${ctx.link(df_helper_1.Dataflow.origin)} for a more general solution, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
|
|
544
544
|
|
|
@@ -1191,7 +1191,7 @@ ${ctx.hierarchy('Origin', { openTop: true })}
|
|
|
1191
1191
|
|
|
1192
1192
|
Their respective uses are documented alongside their implementation:
|
|
1193
1193
|
|
|
1194
|
-
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort(
|
|
1194
|
+
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort(strings_1.compareByCodeUnit).map(key => `- ${ctx.link(key)}\\\n${ctx.doc(key, { type: 'interface' })}`).join('\n')}
|
|
1195
1195
|
|
|
1196
1196
|
Please note, the current structure of this function is biased by what implementations already exist in flowR.
|
|
1197
1197
|
Hence, we do not just track definitions and constants, but also the origins of function calls, albeit we do not yet track the origins of values (only resorting to
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WikiInterface = void 0;
|
|
4
|
+
const r_string_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
4
5
|
const shell_1 = require("../r-bridge/shell");
|
|
5
6
|
const doc_query_1 = require("./doc-util/doc-query");
|
|
6
7
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
@@ -66,7 +67,7 @@ ${(0, doc_code_1.codeBlock)('shell', 'nc 127.0.0.1 1042')}
|
|
|
66
67
|
|
|
67
68
|
Within the started session, type the following message (as a single line) and press enter to see the response:
|
|
68
69
|
|
|
69
|
-
${(0, doc_code_1.codeBlock)('json',
|
|
70
|
+
${(0, doc_code_1.codeBlock)('json', r_string_1.RString.unquote(JSON.stringify({ type: 'request-file-analysis', content: 'x <- 1', id: '1' })))}
|
|
70
71
|
|
|
71
72
|
</details>
|
|
72
73
|
</li>
|
|
@@ -84,7 +85,7 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
|
84
85
|
s.connect(('127.0.0.1', 1042))
|
|
85
86
|
print(s.recv(4096)) # for the hello message
|
|
86
87
|
|
|
87
|
-
s.send(b'${
|
|
88
|
+
s.send(b'${r_string_1.RString.unquote(JSON.stringify({ type: 'request-file-analysis', content: 'x <- 1', id: '1' }))}\\n')
|
|
88
89
|
|
|
89
90
|
print(s.recv(65536)) # for the response (please use a more sophisticated mechanism)
|
|
90
91
|
`)}
|
|
@@ -4,8 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.WikiLinter = void 0;
|
|
7
|
+
const r_string_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
7
8
|
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
8
9
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
10
|
+
const conformance_1 = require("../linter/rules/cmd-check/conformance");
|
|
9
11
|
const linter_rules_1 = require("../linter/linter-rules");
|
|
10
12
|
const doc_code_1 = require("./doc-util/doc-code");
|
|
11
13
|
const doc_query_1 = require("./doc-util/doc-query");
|
|
@@ -209,12 +211,12 @@ These examples are synthesized from the test cases in: ${(0, doc_files_1.linkFlo
|
|
|
209
211
|
continue;
|
|
210
212
|
}
|
|
211
213
|
// drop any quotes around the test name
|
|
212
|
-
const testNameClean =
|
|
214
|
+
const testNameClean = r_string_1.RString.unquote(testName);
|
|
213
215
|
result += `\n${(0, doc_structure_1.section)('Test Case: ' + testNameClean, 4)}
|
|
214
216
|
|
|
215
217
|
${report.comments ? report.comments.map(c => `> ${c}`).join('\n') + '\n' : ''}
|
|
216
218
|
Given the following input:
|
|
217
|
-
${(0, doc_code_1.codeBlock)('r', args[2].getText(report.source)
|
|
219
|
+
${(0, doc_code_1.codeBlock)('r', r_string_1.RString.unquote(args[2].getText(report.source)).replace(/\\n/g, '\n'))}
|
|
218
220
|
${args.length >= 7 ? `\nAnd using the following [configuration](#configuration): ${(0, doc_code_1.codeBlock)('ts', prettyPrintExpectedOutput(args[6].getText(report.source)))}` : ''}
|
|
219
221
|
|
|
220
222
|
We expect the linter to report the following:
|
|
@@ -276,6 +278,25 @@ function(x) {
|
|
|
276
278
|
rule(knownParser, 'unused-import', 'UnusedImportConfig', 'UNUSED_IMPORT', 'lint-unused-import', 'library(stats)\nprint("no stats function is used")', tagTypes);
|
|
277
279
|
rule(knownParser, 'unescaped-arguments', 'UnescapedArgumentsConfig', 'UNESCAPED_ARGUMENTS', 'lint-unescaped-arguments', 'function(dir) {\n\tsystem(paste0("ls ", dir))\n}', tagTypes);
|
|
278
280
|
rule(knownParser, 'namespace-access', 'NamespaceAccessConfig', 'NAMESPACE_ACCESS', 'lint-namespace-access', 'dplyr:::filter(df, x > 1)', tagTypes);
|
|
281
|
+
rule(knownParser, 'description-metadata', 'DescriptionMetadataConfig', 'DESCRIPTION_METADATA', 'cmd-check/lint-description-metadata', 'cat("a package with a malformed DESCRIPTION")', tagTypes);
|
|
282
|
+
rule(knownParser, 'documentation-mismatch', 'DocumentationMismatchConfig', 'DOCUMENTATION_MISMATCH', 'cmd-check/lint-documentation-mismatch', 'f <- function(x, y) x + y', tagTypes);
|
|
283
|
+
rule(knownParser, 'non-ascii-code', 'NonAsciiCodeConfig', 'NON_ASCII_CODE', 'cmd-check/lint-non-ascii-code', 'escaped <- function() message("Gr\\u00fc\\u00dfe")\nliteral <- function() message("Gr\u00fc\u00dfe")', tagTypes);
|
|
284
|
+
rule(knownParser, 'class-string-comparison', 'ClassStringComparisonConfig', 'CLASS_STRING_COMPARISON', 'cmd-check/lint-class-string-comparison', 'f <- function(x) if(class(x) == "data.frame") nrow(x) else length(x)', tagTypes);
|
|
285
|
+
rule(knownParser, 'true-false-abbreviation', 'TrueFalseAbbreviationConfig', 'TRUE_FALSE_ABBREVIATION', 'cmd-check/lint-true-false-abbreviation', 'f <- function(x) mean(x, na.rm = T)', tagTypes);
|
|
286
|
+
rule(knownParser, 'bogus-return', 'BogusReturnConfig', 'BOGUS_RETURN', 'cmd-check/lint-bogus-return', 'f <- function(x) {\n\tif(is.null(x)) return\n\tx + 1\n}', tagTypes);
|
|
287
|
+
rule(knownParser, 'package-hooks', 'PackageHooksConfig', 'PACKAGE_HOOKS', 'cmd-check/lint-package-hooks', '.onLoad <- function(libname, pkgname) {\n\tlibrary(stats)\n\tcat("Welcome!")\n}', tagTypes);
|
|
288
|
+
rule(knownParser, 'global-environment-modification', 'GlobalEnvironmentModificationConfig', 'GLOBAL_ENVIRONMENT_MODIFICATION', 'cmd-check/lint-global-environment-modification', 'cache <- function(v) assign("cached", v, envir = globalenv())\ncount <- function() counter <<- counter + 1', tagTypes);
|
|
289
|
+
rule(knownParser, 'namespace-tampering', 'NamespaceTamperingConfig', 'NAMESPACE_TAMPERING', 'cmd-check/lint-namespace-tampering', 'patch <- function() assignInNamespace("mean", function(x, ...) 42, "base")', tagTypes);
|
|
290
|
+
rule(knownParser, 's3-method-consistency', 'S3MethodConsistencyConfig', 'S3_METHOD_CONSISTENCY', 'cmd-check/lint-s-three-method-consistency', 'print.myclass <- function(obj) cat("myclass")\n`size<-` <- function(x, v) { attr(x, "size") <- v; x }', tagTypes);
|
|
291
|
+
rule(knownParser, 'foreign-function-calls', 'ForeignFunctionCallsConfig', 'FOREIGN_FUNCTION_CALLS', 'cmd-check/lint-foreign-function-calls', 'f <- function(x) .Call("C_mean", x)', tagTypes);
|
|
292
|
+
rule(knownParser, 'dependency-declaration', 'DependencyDeclarationConfig', 'DEPENDENCY_DECLARATION', 'cmd-check/lint-dependency-declaration', 'f <- function(df) {\n\tlibrary(dplyr)\n\ttidyr::drop_na(df)\n}', tagTypes);
|
|
293
|
+
rule(knownParser, 'call-arguments', 'CallArgumentsConfig', 'CALL_ARGUMENTS', 'cmd-check/lint-call-arguments', 'scale_by <- function(x, factor) x * factor\nf <- function(x) scale_by(x, fact = 2, center = TRUE)', tagTypes);
|
|
294
|
+
rule(knownParser, 'package-structure', 'PackageStructureConfig', 'PACKAGE_STRUCTURE', 'cmd-check/lint-package-structure', 'f <- function() 1', tagTypes);
|
|
295
|
+
rule(knownParser, 'compiled-code', 'CompiledCodeConfig', 'COMPILED_CODE', 'cmd-check/lint-compiled-code', 'f <- function(x) .Call("C_f", x)', tagTypes);
|
|
296
|
+
rule(knownParser, 'package-metafiles', 'PackageMetafilesConfig', 'PACKAGE_METAFILES', 'cmd-check/lint-package-metafiles', 'f <- function() 1', tagTypes);
|
|
297
|
+
rule(knownParser, 'rd-files', 'RdFilesConfig', 'RD_FILES', 'cmd-check/lint-rd-files', 'f <- function() 1', tagTypes);
|
|
298
|
+
rule(knownParser, 'package-data', 'PackageDataConfig', 'PACKAGE_DATA', 'cmd-check/lint-package-data', 'f <- function() 1', tagTypes);
|
|
299
|
+
rule(knownParser, 'package-runtime', 'PackageRuntimeConfig', 'PACKAGE_RUNTIME', 'cmd-check/lint-package-runtime', 'f <- function() library(pkg)', tagTypes);
|
|
279
300
|
function rule(parser, name, configType, ruleType, testfile, example, types) {
|
|
280
301
|
const rule = linter_rules_1.LintingRules[name];
|
|
281
302
|
const tags = rule.info.tags.toSorted((a, b) => {
|
|
@@ -299,7 +320,7 @@ function(x) {
|
|
|
299
320
|
if (format === 'short') {
|
|
300
321
|
ruleExplanations.set(name, () => Promise.resolve(`
|
|
301
322
|
**[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name))}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
|
|
302
|
-
${tags}
|
|
323
|
+
${tags}${cmdCheckStepsOf(name, false) === '' ? '' : `\\\n\t${cmdCheckStepsOf(name, false)}`}
|
|
303
324
|
|
|
304
325
|
`.trim()));
|
|
305
326
|
}
|
|
@@ -311,6 +332,7 @@ ${(0, doc_structure_1.section)(rule.info.name + ` <sup>[<a href="${doc_file
|
|
|
311
332
|
|
|
312
333
|
${tags}
|
|
313
334
|
|
|
335
|
+
${cmdCheckStepsOf(name, true)}
|
|
314
336
|
|
|
315
337
|
This rule is a ${certaintyText} rule.
|
|
316
338
|
|
|
@@ -333,13 +355,23 @@ The linting query can be used to run this rule on the above example:
|
|
|
333
355
|
|
|
334
356
|
${await (0, doc_query_1.showQuery)(parser, example, [{ type: 'linter', rules: [{ name, config: {} }] }], { collapseQuery: true })}
|
|
335
357
|
|
|
336
|
-
${buildSamplesFromLinterTestCases(parser, `${testfile}.test.ts`)}
|
|
358
|
+
${rule.info.tags.includes(linter_tags_1.LintingRuleTag.CmdCheck) ? `More examples are the test cases in ${(0, doc_files_1.linkFlowRSourceFile)(`test/functionality/linter/${testfile}.test.ts`)}.` : buildSamplesFromLinterTestCases(parser, `${testfile}.test.ts`)}
|
|
337
359
|
|
|
338
360
|
`.trim());
|
|
339
361
|
}
|
|
340
362
|
}
|
|
341
363
|
return ruleExplanations;
|
|
342
364
|
}
|
|
365
|
+
const ConformanceSymbol = {
|
|
366
|
+
[conformance_1.ConformanceLevel.Full]: '๐ฉ',
|
|
367
|
+
[conformance_1.ConformanceLevel.Static]: '๐ท',
|
|
368
|
+
[conformance_1.ConformanceLevel.Partial]: '๐ถ'
|
|
369
|
+
};
|
|
370
|
+
/** the R CMD check steps a rule covers, as links into the conformance table */
|
|
371
|
+
function cmdCheckStepsOf(name, withCoverage) {
|
|
372
|
+
const steps = (0, conformance_1.numberedConformance)().filter(e => e.rules.includes(name));
|
|
373
|
+
return steps.length === 0 ? '' : `R CMD check: ${steps.map(e => `[#${e.number}](${doc_files_1.FlowrWikiBaseRef}/Linter#cmd-check-${e.number})${withCoverage ? ` ${ConformanceSymbol[e.level]}` : ''}`).join(', ')}`;
|
|
374
|
+
}
|
|
343
375
|
function getAllLintingRulesWithTag(tag) {
|
|
344
376
|
return Object.entries(linter_rules_1.LintingRules).filter(([_, rule]) => rule.info.tags.includes(tag)).map(([name]) => name);
|
|
345
377
|
}
|
|
@@ -389,6 +421,24 @@ ${await (async () => {
|
|
|
389
421
|
return result;
|
|
390
422
|
})()}
|
|
391
423
|
|
|
424
|
+
${(0, doc_structure_1.section)('R CMD check Conformance', 2, 'r-cmd-check-conformance')}
|
|
425
|
+
|
|
426
|
+
Rules tagged ${makeTagBadge(linter_tags_1.LintingRuleTag.CmdCheck, tagTypes.info)} port \`R CMD check\` (R 4.6.1, see [Writing R Extensions](${conformance_1.WritingRExtensionsCmdCheck}) and [R Packages](${conformance_1.RPackagesCmdCheck})).
|
|
427
|
+
They run by default only for packages (config option \`linter.disabledTags\`).
|
|
428
|
+
Below are all steps of \`R CMD check\`, numbered by us (R itself prints them as \`* checking ...\`), each linked to its code in [R's \`check.R\`](${conformance_1.CmdCheckSource}) and its section in R Packages.
|
|
429
|
+
|
|
430
|
+
| | Coverage |
|
|
431
|
+
| :-: | :-- |
|
|
432
|
+
| ${ConformanceSymbol.full} | everything the step reports |
|
|
433
|
+
| ${ConformanceSymbol.static} | what can be decided without building, installing, or running the package |
|
|
434
|
+
| ${ConformanceSymbol.partial} | part of what the step reports |
|
|
435
|
+
|
|
436
|
+
${conformance_1.CmdCheckConformance.map(({ area }) => `${(0, doc_structure_1.section)(area, 3)}
|
|
437
|
+
|
|
438
|
+
| # | Step (\`checking ...\`) | | Rules | Note |
|
|
439
|
+
| --: | :-- | :-: | :-- | :-- |
|
|
440
|
+
${(0, conformance_1.numberedConformance)().filter(e => e.area === area).map(e => `| <a id="cmd-check-${e.number}"></a>${e.number} | [${e.check.replaceAll('|', '\\|')}](${conformance_1.CmdCheckSource}#L${e.line}) ([book](${conformance_1.RPackagesCmdCheck}#${e.book})) | ${ConformanceSymbol[e.level]} | ${e.rules.map(r => linkToRule(r)).join(', ')} | ${(e.note ?? '').replaceAll('|', '\\|')} |`).join('\n')}`).join('\n\n')}
|
|
441
|
+
|
|
392
442
|
${(0, doc_structure_1.section)('Quick Fixes', 2, 'quick-fixes')}
|
|
393
443
|
|
|
394
444
|
Rules tagged ${makeTagBadge(linter_tags_1.LintingRuleTag.QuickFix, tagTypes.info)} attach a ${(0, doc_types_1.shortLink)('LintQuickFix', tagTypes.info)} to their results,
|
|
@@ -33,8 +33,7 @@ const UrlEncodedHomePath = /(?:[a-z]%3A)?(%2F|%5C)(?:home|users)\1(?:[\w.%-]+\1)
|
|
|
33
33
|
const DefaultReplacementPatterns = [
|
|
34
34
|
// mute signature database load time variance in wiki table (before the `ms` rule, which would eat half of it)
|
|
35
35
|
[/โ\s*<?[\d.]+\s*[ยตm]s/g, ''],
|
|
36
|
-
|
|
37
|
-
[/\d+(\.\d+)?(โ|\s*)?ms/g, ''],
|
|
36
|
+
[/\d+(\.\d+)?(\u2009|\s*)?ms/g, ''],
|
|
38
37
|
[/tmp[%A-Za-z0-9-]+/g, ''],
|
|
39
38
|
[/"?(timing|searchTimeMs|processTimeMs|id|tsId)"?:\s*\d+(\.\d)?,?/g, ''],
|
|
40
39
|
[/"format":"compact"[^\n\r]*/giu, ''],
|
|
@@ -546,6 +546,13 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({ inputSources: {
|
|
|
546
546
|
shortDescription: 'Returns all direct dependencies (in- and outputs) of a given R script',
|
|
547
547
|
buildExplanation: async (shell, ctx) => {
|
|
548
548
|
const exampleCode = 'library(x)';
|
|
549
|
+
const transformCode = `
|
|
550
|
+
library(dplyr)
|
|
551
|
+
library(ggplot2)
|
|
552
|
+
small <- measurements |> filter(x > 1) |> select(x, y)
|
|
553
|
+
p <- ggplot(small, aes(x, y)) + geom_point() + ggtitle("Small")
|
|
554
|
+
ggsave("small.png", plot = p)
|
|
555
|
+
`;
|
|
549
556
|
const longerCode = `
|
|
550
557
|
source("sample.R")
|
|
551
558
|
foo <- loadNamespace("bar")
|
|
@@ -592,6 +599,24 @@ ${await (0, doc_query_1.showQuery)(shell, 'sd(c(1, 2, 3))', [{ type: 'dependenci
|
|
|
592
599
|
convention and \`R_DEFAULT_PACKAGES\` (or \`options(defaultPackages=)\`) can drop any of them, whereas \`base\` is always
|
|
593
600
|
there and cannot be detached -- so it is never something the script could have asked for, and never something to
|
|
594
601
|
suggest a \`library\` call for.
|
|
602
|
+
|
|
603
|
+
Beyond libraries, files and outputs, the query knows the \`visualize\` category (plots) and the \`transform\` category
|
|
604
|
+
(\`Data Transformations\`): the calls that reshape, filter, join or aggregate data, like \`dplyr::filter\`, \`tidyr::pivot_longer\`,
|
|
605
|
+
\`merge\`, \`aggregate\` or \`data.table::setDT\`. The category is read from the built-in configuration: every built-in labeled
|
|
606
|
+
\`SemanticCallTag.Transforms\` belongs to it. Every such built-in names its package, so \`filter\` is only a transformation when it
|
|
607
|
+
resolves to \`dplyr\` and never for the time-series \`stats::filter\`.
|
|
608
|
+
|
|
609
|
+
The \`read\`, \`write\`, \`visualize\`, and \`transform\` entries additionally state how data flows through the call,
|
|
610
|
+
resolved with the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')} instead of the syntax:
|
|
611
|
+
* \`inputVariables\` (for \`write\`, \`visualize\`, and \`transform\`) are the variables the result is computed from, through every call
|
|
612
|
+
in between. What an argument's role in the signature excludes (a file, a flag, a callee) is no input, nor is what a call quotes or
|
|
613
|
+
looks up in a data mask: \`df\` for \`df |> filter(x > 1)\`, both \`a\` and \`b\` for \`left_join(a, b)\`. An addon to a plot draws its data.
|
|
614
|
+
* \`assignedTo\` (for \`read\`, \`visualize\`, and \`transform\`) is the variable the result is stored in, following every call that hands
|
|
615
|
+
it on (a pipe into a call, parentheses, a \`+\` adding to a plot) up to \`<-\`, \`=\` or \`->\`: \`small\` for \`small <- filter(df, x > 1)\`, and
|
|
616
|
+
nothing for \`f(filter(df, x > 1))\`.
|
|
617
|
+
* Every plot additionally carries its \`title\` (from \`ggtitle\`, \`labs(title = )\` or \`main =\`) and the file it is written to as \`savedTo\`
|
|
618
|
+
(by \`ggsave\`, which names its \`plot\` or saves \`last_plot()\`, or by the graphics device open when it is drawn).
|
|
619
|
+
${await (0, doc_query_1.showQuery)(shell, transformCode, [{ type: 'dependencies', enabledCategories: ['transform', 'visualize'] }], { showCode: true, collapseQuery: true, collapseResult: false, ctx })}
|
|
595
620
|
`;
|
|
596
621
|
}
|
|
597
622
|
});
|
|
@@ -7,6 +7,7 @@ const vertex_1 = require("../dataflow/graph/vertex");
|
|
|
7
7
|
const flowr_search_executor_1 = require("../search/flowr-search-executor");
|
|
8
8
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
9
9
|
const flowr_search_1 = require("../search/flowr-search");
|
|
10
|
+
const strings_1 = require("../util/text/strings");
|
|
10
11
|
/**
|
|
11
12
|
* https://github.com/flowr-analysis/flowr/wiki/Search-API
|
|
12
13
|
*/
|
|
@@ -50,7 +51,7 @@ also allow you to pass in a regex to only match files that fit your specified pa
|
|
|
50
51
|
|
|
51
52
|
We offer the following generators:
|
|
52
53
|
|
|
53
|
-
${Object.keys(flowr_search_builder_1.Q).filter(n => n !== 'name').sort(
|
|
54
|
+
${Object.keys(flowr_search_builder_1.Q).filter(n => n !== 'name').sort(strings_1.compareByCodeUnit).map(key => `- ${ctx.linkO(flowr_search_builder_1.FlowrSearchGenerator, key)}\\\n${ctx.docO(flowr_search_builder_1.FlowrSearchGenerator, key)}`).join('\n')}
|
|
54
55
|
|
|
55
56
|
Likewise, we have a palette of _transformers_ and _modifiers_:
|
|
56
57
|
|
|
@@ -10,8 +10,6 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
10
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
11
11
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
12
12
|
const reader_1 = require("../project/sigdb/reader");
|
|
13
|
-
// FnProp is a const enum referenced only via `typeof` (for linkE's member typing); a type-only import would break `typeof`
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
15
13
|
const schema_1 = require("../project/sigdb/schema");
|
|
16
14
|
const manifest_1 = require("../project/sigdb/manifest");
|
|
17
15
|
const codec_1 = require("../project/sigdb/codec");
|
|
@@ -46,6 +46,10 @@ async function executeLintingRule(ruleName, input, lintingRuleConfig) {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
|
49
|
+
/* a project without any code (e.g. a package of data only) has nothing to lint, which is no error of the rule */
|
|
50
|
+
if (!input.inspectContext().files.hasRequests()) {
|
|
51
|
+
return { results: [], '.meta': { searchTimeMs: 0, processTimeMs: 0 } };
|
|
52
|
+
}
|
|
49
53
|
return {
|
|
50
54
|
error: e
|
|
51
55
|
};
|