@eagleoutice/flowr 2.6.2 → 2.7.0
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 +36 -34
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.js +6 -6
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
- package/abstract-interpretation/data-frame/dataframe-domain.js +5 -11
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +7 -7
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +28 -24
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +3 -2
- package/abstract-interpretation/data-frame/semantics.js +54 -41
- package/abstract-interpretation/data-frame/shape-inference.d.ts +3 -3
- package/abstract-interpretation/data-frame/shape-inference.js +3 -3
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
- package/abstract-interpretation/domains/abstract-domain.js +3 -2
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +2 -2
- package/abstract-interpretation/domains/interval-domain.js +3 -6
- package/abstract-interpretation/domains/lattice.d.ts +2 -0
- package/abstract-interpretation/domains/lattice.js +3 -1
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
- package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +98 -0
- package/abstract-interpretation/domains/set-range-domain.js +400 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
- package/abstract-interpretation/domains/singleton-domain.js +2 -2
- package/abstract-interpretation/normalized-ast-fold.d.ts +1 -1
- package/benchmark/slicer.d.ts +3 -1
- package/benchmark/slicer.js +50 -27
- package/benchmark/stats/print.js +8 -5
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/summarizer/data.d.ts +11 -8
- package/benchmark/summarizer/first-phase/process.js +12 -9
- package/benchmark/summarizer/second-phase/graph.d.ts +3 -1
- package/benchmark/summarizer/second-phase/graph.js +3 -1
- package/benchmark/summarizer/second-phase/process.js +24 -18
- package/cli/export-quads-app.js +1 -1
- package/cli/repl/commands/repl-dataflow.js +2 -1
- package/cli/repl/commands/repl-parse.js +16 -4
- package/cli/repl/commands/repl-query.js +1 -1
- package/cli/repl/core.js +16 -13
- package/cli/repl/server/connection.js +2 -1
- package/cli/script-core/statistics-helper-core.js +2 -1
- package/cli/slicer-app.js +3 -4
- package/cli/wiki.d.ts +4 -0
- package/cli/wiki.js +165 -0
- package/config.d.ts +4 -0
- package/config.js +6 -0
- package/control-flow/cfg-dead-code.js +14 -3
- package/control-flow/cfg-simplification.d.ts +5 -2
- package/control-flow/cfg-simplification.js +3 -0
- package/control-flow/extract-cfg.d.ts +9 -3
- package/control-flow/extract-cfg.js +44 -4
- package/control-flow/semantic-cfg-guided-visitor.d.ts +2 -2
- package/control-flow/simple-visitor.js +2 -2
- package/control-flow/useless-loop.d.ts +3 -3
- package/control-flow/useless-loop.js +16 -5
- package/core/pipeline-executor.d.ts +3 -6
- package/core/pipeline-executor.js +4 -7
- package/core/print/normalize-printer.d.ts +1 -1
- package/core/print/normalize-printer.js +2 -2
- package/core/steps/all/core/00-parse.d.ts +1 -1
- package/core/steps/all/core/00-parse.js +1 -1
- package/core/steps/all/core/10-normalize.d.ts +3 -9
- package/core/steps/all/core/10-normalize.js +1 -16
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -3
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -3
- package/core/steps/all/core/20-dataflow.d.ts +3 -4
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +4 -2
- package/core/steps/all/static-slicing/00-slice.js +3 -2
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +8 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +4 -1
- package/core/steps/pipeline/default-pipelines.d.ts +94 -95
- package/core/steps/pipeline/default-pipelines.js +8 -8
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/append.d.ts +5 -0
- package/dataflow/environments/append.js +6 -20
- package/dataflow/environments/built-in.d.ts +2 -1
- package/dataflow/environments/clone.d.ts +1 -2
- package/dataflow/environments/clone.js +3 -17
- package/dataflow/environments/define.d.ts +7 -3
- package/dataflow/environments/define.js +9 -56
- package/dataflow/environments/diff.js +3 -3
- package/dataflow/environments/environment.d.ts +48 -28
- package/dataflow/environments/environment.js +187 -62
- package/dataflow/environments/overwrite.d.ts +1 -5
- package/dataflow/environments/overwrite.js +2 -61
- package/dataflow/environments/reference-to-maybe.d.ts +13 -0
- package/dataflow/environments/reference-to-maybe.js +54 -0
- package/dataflow/environments/resolve-by-name.d.ts +6 -1
- package/dataflow/environments/resolve-by-name.js +56 -4
- package/dataflow/environments/scoping.d.ts +8 -4
- package/dataflow/environments/scoping.js +13 -9
- package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
- package/dataflow/eval/resolve/alias-tracking.js +15 -13
- package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
- package/dataflow/eval/resolve/resolve-argument.js +10 -10
- package/dataflow/eval/resolve/resolve.d.ts +13 -11
- package/dataflow/eval/resolve/resolve.js +16 -15
- package/dataflow/eval/values/string/string-constants.d.ts +9 -3
- package/dataflow/eval/values/string/string-constants.js +9 -3
- package/dataflow/extractor.d.ts +2 -3
- package/dataflow/extractor.js +25 -28
- package/dataflow/fn/higher-order-function.d.ts +2 -1
- package/dataflow/fn/higher-order-function.js +4 -4
- package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
- package/dataflow/graph/dataflowgraph-builder.js +21 -11
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +13 -11
- package/dataflow/graph/graph.js +40 -24
- package/dataflow/graph/invert-dfg.d.ts +3 -2
- package/dataflow/graph/invert-dfg.js +3 -3
- package/dataflow/graph/resolve-graph.d.ts +2 -1
- package/dataflow/graph/resolve-graph.js +2 -2
- package/dataflow/graph/unknown-replacement.d.ts +4 -2
- package/dataflow/graph/unknown-replacement.js +4 -2
- package/dataflow/graph/vertex.d.ts +3 -3
- package/dataflow/graph/vertex.js +3 -3
- package/dataflow/info.d.ts +8 -1
- package/dataflow/info.js +21 -0
- package/dataflow/internal/linker.js +10 -11
- package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -2
- package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -3
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +10 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +10 -14
- 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 +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +15 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +78 -75
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
- package/dataflow/internal/process/functions/call/common.d.ts +1 -1
- package/dataflow/internal/process/functions/call/common.js +6 -7
- package/dataflow/internal/process/functions/call/default-call-handling.d.ts +3 -1
- package/dataflow/internal/process/functions/call/default-call-handling.js +3 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +4 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +4 -4
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
- package/dataflow/internal/process/functions/process-argument.js +1 -1
- package/dataflow/internal/process/functions/process-parameter.js +4 -4
- package/dataflow/internal/process/process-symbol.js +1 -1
- package/dataflow/internal/process/process-value.d.ts +1 -1
- package/dataflow/internal/process/process-value.js +7 -7
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +1 -1
- package/dataflow/processor.d.ts +7 -16
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +0 -2
- package/documentation/data/faq/faqs.js +27 -18
- package/documentation/data/faq/recommended-configs.d.ts +36 -0
- package/documentation/data/faq/recommended-configs.js +40 -0
- package/documentation/data/faq/wiki-faq-store.d.ts +1 -0
- package/documentation/data/faq/wiki-faq-store.js +10 -2
- package/documentation/data/server/doc-data-server-messages.js +1 -1
- package/documentation/doc-capabilities.d.ts +9 -0
- package/documentation/{print-capabilities-markdown.js → doc-capabilities.js} +18 -21
- package/documentation/doc-readme.d.ts +9 -0
- package/documentation/{print-readme.js → doc-readme.js} +31 -35
- package/documentation/doc-util/doc-benchmarks.d.ts +6 -4
- package/documentation/doc-util/doc-benchmarks.js +6 -4
- package/documentation/doc-util/doc-cfg.js +5 -8
- package/documentation/doc-util/doc-dfg.d.ts +7 -7
- package/documentation/doc-util/doc-dfg.js +15 -14
- package/documentation/doc-util/doc-escape.d.ts +6 -0
- package/documentation/doc-util/doc-escape.js +11 -0
- package/documentation/doc-util/doc-general.d.ts +22 -2
- package/documentation/doc-util/doc-general.js +22 -2
- package/documentation/doc-util/doc-normalized-ast.d.ts +10 -5
- package/documentation/doc-util/doc-normalized-ast.js +14 -10
- package/documentation/doc-util/doc-query.d.ts +12 -4
- package/documentation/doc-util/doc-query.js +18 -11
- package/documentation/doc-util/doc-search.d.ts +0 -30
- package/documentation/doc-util/doc-search.js +2 -73
- package/documentation/doc-util/doc-server-message.d.ts +5 -5
- package/documentation/doc-util/doc-server-message.js +4 -4
- package/documentation/doc-util/doc-types.d.ts +69 -32
- package/documentation/doc-util/doc-types.js +109 -62
- package/documentation/index.d.ts +9 -9
- package/documentation/index.js +9 -9
- package/documentation/issue-linting-rule.d.ts +9 -0
- package/documentation/{print-linter-issue.js → issue-linting-rule.js} +20 -23
- package/documentation/wiki-analyzer.d.ts +9 -0
- package/documentation/wiki-analyzer.js +425 -0
- package/documentation/wiki-cfg.d.ts +9 -0
- package/documentation/{print-cfg-wiki.js → wiki-cfg.js} +144 -160
- package/documentation/wiki-core.d.ts +14 -0
- package/documentation/{print-core-wiki.js → wiki-core.js} +164 -175
- package/documentation/wiki-dataflow-graph.d.ts +9 -0
- package/documentation/{print-dataflow-graph-wiki.js → wiki-dataflow-graph.js} +146 -177
- package/documentation/wiki-engine.d.ts +9 -0
- package/documentation/{print-engines-wiki.js → wiki-engine.js} +27 -42
- package/documentation/wiki-faq.d.ts +8 -0
- package/documentation/wiki-faq.js +21 -0
- package/documentation/wiki-interface.d.ts +9 -0
- package/documentation/{print-interface-wiki.js → wiki-interface.js} +59 -56
- package/documentation/wiki-linter.d.ts +9 -0
- package/documentation/{print-linter-wiki.js → wiki-linter.js} +52 -48
- package/documentation/wiki-linting-and-testing.d.ts +9 -0
- package/documentation/{print-linting-and-testing-wiki.js → wiki-linting-and-testing.js} +25 -32
- package/documentation/wiki-mk/doc-context.d.ts +186 -0
- package/documentation/wiki-mk/doc-context.js +84 -0
- package/documentation/wiki-mk/doc-maker.d.ts +95 -0
- package/documentation/wiki-mk/doc-maker.js +134 -0
- package/documentation/wiki-normalized-ast.d.ts +9 -0
- package/documentation/{print-normalized-ast-wiki.js → wiki-normalized-ast.js} +64 -47
- package/documentation/wiki-onboarding.d.ts +8 -0
- package/documentation/{print-onboarding-wiki.js → wiki-onboarding.js} +18 -15
- package/documentation/wiki-query.d.ts +9 -0
- package/documentation/{print-query-wiki.js → wiki-query.js} +62 -47
- package/documentation/wiki-search.d.ts +9 -0
- package/documentation/wiki-search.js +61 -0
- package/linter/linter-executor.js +3 -2
- package/linter/linter-format.d.ts +2 -2
- package/linter/linter-rules.d.ts +15 -19
- package/linter/rules/absolute-path.d.ts +1 -2
- package/linter/rules/absolute-path.js +5 -5
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +13 -9
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.d.ts +1 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/file-path-validity.js +4 -4
- package/linter/rules/function-finder-util.d.ts +3 -7
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +4 -3
- package/linter/rules/seeded-randomness.js +38 -18
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +2 -2
- package/linter/rules/useless-loop.js +2 -2
- package/package.json +5 -17
- package/project/cache/flowr-analyzer-cache.d.ts +7 -10
- package/project/cache/flowr-analyzer-cache.js +17 -38
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +34 -0
- package/project/cache/flowr-analyzer-controlflow-cache.js +79 -0
- package/project/context/flowr-analyzer-context.d.ts +37 -5
- package/project/context/flowr-analyzer-context.js +51 -4
- package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
- package/project/context/flowr-analyzer-environment-context.js +50 -0
- package/project/context/flowr-analyzer-files-context.d.ts +63 -13
- package/project/context/flowr-analyzer-files-context.js +110 -39
- package/project/context/flowr-file.d.ts +32 -10
- package/project/context/flowr-file.js +30 -9
- package/project/flowr-analyzer-builder.d.ts +22 -28
- package/project/flowr-analyzer-builder.js +32 -70
- package/project/flowr-analyzer.d.ts +55 -14
- package/project/flowr-analyzer.js +53 -8
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +7 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +13 -5
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +3 -3
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +11 -5
- package/project/plugins/file-plugins/flowr-description-file.d.ts +3 -3
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +33 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.js +42 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.d.ts +59 -0
- package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.js +132 -0
- package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
- package/project/plugins/file-plugins/notebooks/notebook.js +2 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +5 -0
- package/project/plugins/flowr-analyzer-plugin-defaults.js +23 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +2 -0
- package/project/plugins/flowr-analyzer-plugin.js +2 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/plugin-registry.d.ts +34 -0
- package/project/plugins/plugin-registry.js +62 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -6
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +5 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +25 -18
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +5 -5
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +6 -6
- package/queries/catalog/df-shape-query/df-shape-query-format.js +8 -7
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +4 -4
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.js +13 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -1
- 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 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +3 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +3 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +13 -1
- package/queries/query.d.ts +26 -18
- package/queries/query.js +21 -1
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/collect.js +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +15 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +5 -7
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +24 -11
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/type.js +2 -0
- package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +9 -8
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +11 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +4 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +20 -11
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -3
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +5 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +3 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +14 -5
- package/r-bridge/parser.d.ts +15 -5
- package/r-bridge/parser.js +27 -13
- package/r-bridge/retriever.d.ts +9 -15
- package/r-bridge/retriever.js +14 -5
- package/r-bridge/shell.d.ts +1 -1
- package/r-bridge/shell.js +1 -1
- package/reconstruct/auto-select/auto-select-defaults.d.ts +0 -1
- package/reconstruct/auto-select/magic-comments.js +1 -1
- package/reconstruct/reconstruct.d.ts +17 -9
- package/reconstruct/reconstruct.js +19 -8
- package/search/flowr-search.d.ts +12 -0
- package/search/search-executor/search-enrichers.d.ts +9 -2
- package/search/search-executor/search-enrichers.js +1 -3
- package/search/search-executor/search-generators.d.ts +1 -1
- package/search/search-executor/search-generators.js +9 -4
- package/slicing/criterion/collect-all.d.ts +3 -2
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/criterion/parse.js +4 -4
- package/slicing/static/slice-call.d.ts +3 -2
- package/slicing/static/slice-call.js +4 -4
- package/slicing/static/static-slicer.d.ts +3 -1
- package/slicing/static/static-slicer.js +6 -7
- package/statistics/features/supported/assignments/assignments.js +1 -1
- package/statistics/features/supported/control-flow/control-flow.js +2 -2
- package/statistics/features/supported/data-access/data-access.js +1 -1
- package/statistics/features/supported/defined-functions/defined-functions.js +1 -1
- package/statistics/features/supported/expression-list/statistics-expression-list.js +1 -1
- package/statistics/features/supported/loops/loops.js +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +2 -2
- package/statistics/features/supported/variables/variables.js +3 -2
- package/statistics/statistics.js +3 -2
- package/util/assert.d.ts +4 -0
- package/util/assert.js +4 -0
- package/util/containers.js +1 -1
- package/util/files.d.ts +1 -1
- package/util/files.js +1 -1
- package/util/mermaid/ast.d.ts +4 -3
- package/util/mermaid/ast.js +36 -8
- package/util/mermaid/cfg.js +1 -1
- package/util/mermaid/dfg.d.ts +1 -0
- package/util/mermaid/dfg.js +3 -3
- package/util/simple-df/dfg-view.d.ts +2 -1
- package/util/simple-df/dfg-view.js +2 -2
- package/util/version.js +1 -1
- package/dataflow/environments/remove.d.ts +0 -12
- package/dataflow/environments/remove.js +0 -52
- package/documentation/print-analyzer-wiki.d.ts +0 -1
- package/documentation/print-analyzer-wiki.js +0 -141
- package/documentation/print-capabilities-markdown.d.ts +0 -1
- package/documentation/print-cfg-wiki.d.ts +0 -1
- package/documentation/print-core-wiki.d.ts +0 -5
- package/documentation/print-dataflow-graph-wiki.d.ts +0 -1
- package/documentation/print-engines-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.d.ts +0 -1
- package/documentation/print-faq-wiki.js +0 -18
- package/documentation/print-interface-wiki.d.ts +0 -1
- package/documentation/print-linter-issue.d.ts +0 -1
- package/documentation/print-linter-wiki.d.ts +0 -1
- package/documentation/print-linting-and-testing-wiki.d.ts +0 -1
- package/documentation/print-normalized-ast-wiki.d.ts +0 -1
- package/documentation/print-onboarding-wiki.d.ts +0 -1
- package/documentation/print-query-wiki.d.ts +0 -1
- package/documentation/print-readme.d.ts +0 -1
- package/documentation/print-search-wiki.d.ts +0 -1
- package/documentation/print-search-wiki.js +0 -74
- package/util/formats/adapter-format.d.ts +0 -6
- package/util/formats/adapter-format.js +0 -3
- package/util/formats/adapter.d.ts +0 -27
- package/util/formats/adapter.js +0 -58
- package/util/formats/adapters/r-adapter.d.ts +0 -4
- package/util/formats/adapters/r-adapter.js +0 -7
- package/util/formats/adapters/rmd-adapter.d.ts +0 -35
- package/util/formats/adapters/rmd-adapter.js +0 -100
|
@@ -3,12 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
6
|
+
exports.WikiLinter = void 0;
|
|
7
7
|
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
8
8
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
9
9
|
const linter_rules_1 = require("../linter/linter-rules");
|
|
10
10
|
const doc_code_1 = require("./doc-util/doc-code");
|
|
11
|
-
const shell_1 = require("../r-bridge/shell");
|
|
12
11
|
const doc_query_1 = require("./doc-util/doc-query");
|
|
13
12
|
const doc_types_1 = require("./doc-util/doc-types");
|
|
14
13
|
const path_1 = __importDefault(require("path"));
|
|
@@ -18,9 +17,9 @@ const linter_tags_1 = require("../linter/linter-tags");
|
|
|
18
17
|
const html_hover_over_1 = require("../util/html-hover-over");
|
|
19
18
|
const strings_1 = require("../util/text/strings");
|
|
20
19
|
const assert_1 = require("../util/assert");
|
|
21
|
-
const doc_print_1 = require("./doc-util/doc-print");
|
|
22
20
|
const doc_functions_1 = require("./doc-util/doc-functions");
|
|
23
21
|
const linter_format_1 = require("../linter/linter-format");
|
|
22
|
+
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
24
23
|
const SpecialTagColors = {
|
|
25
24
|
[linter_tags_1.LintingRuleTag.Bug]: 'red',
|
|
26
25
|
[linter_tags_1.LintingRuleTag.Security]: 'orange',
|
|
@@ -31,6 +30,11 @@ function makeTagBadge(name, info) {
|
|
|
31
30
|
const doc = (0, doc_types_1.getDocumentationForType)('LintingRuleTag::' + name, info, '', { fuzzy: true }).replaceAll('\n', ' ');
|
|
32
31
|
return (0, html_hover_over_1.textWithTooltip)(`<a href='#${name}'> + `-${SpecialTagColors[name] ?? 'teal'}) </a>`, doc);
|
|
33
32
|
}
|
|
33
|
+
function getPageNameForLintingRule(name) {
|
|
34
|
+
// convert file-path-validity to 'Linting Rule: File Path Validity'
|
|
35
|
+
const words = name.split('-').map(w => w.charAt(0).toUpperCase() + w.slice(1));
|
|
36
|
+
return '[Linting Rule] ' + words.join(' ');
|
|
37
|
+
}
|
|
34
38
|
function prettyPrintExpectedOutput(expected) {
|
|
35
39
|
if (expected.trim() === '[]') {
|
|
36
40
|
return '* no lints';
|
|
@@ -50,7 +54,7 @@ function prettyPrintExpectedOutput(expected) {
|
|
|
50
54
|
return line.replace(new RegExp('^' + indentation, 'g'), '');
|
|
51
55
|
}).join('\n');
|
|
52
56
|
}
|
|
53
|
-
function buildSamplesFromLinterTestCases(
|
|
57
|
+
function buildSamplesFromLinterTestCases(_parser, testFile) {
|
|
54
58
|
const reports = (0, doc_functions_1.getFunctionsFromFolder)({ files: [path_1.default.resolve('test/functionality/linter/' + testFile)], fname: /assertLinter/ });
|
|
55
59
|
if (reports.info.length === 0) {
|
|
56
60
|
return '';
|
|
@@ -85,40 +89,40 @@ See [here](${(0, doc_types_1.getTypePathLink)({ filePath: report.source.fileName
|
|
|
85
89
|
}
|
|
86
90
|
return result;
|
|
87
91
|
}
|
|
88
|
-
function registerRules(
|
|
92
|
+
function registerRules(knownParser, tagTypes, format = 'short') {
|
|
89
93
|
const ruleExplanations = new Map();
|
|
90
|
-
rule(
|
|
94
|
+
rule(knownParser, 'deprecated-functions', 'FunctionsToDetectConfig', 'DEPRECATED_FUNCTIONS', 'lint-deprecated-functions', `
|
|
91
95
|
first <- data.frame(x = c(1, 2, 3), y = c(1, 2, 3))
|
|
92
96
|
second <- data.frame(x = c(1, 3, 2), y = c(1, 3, 2))
|
|
93
97
|
dplyr::all_equal(first, second)
|
|
94
98
|
`, tagTypes);
|
|
95
|
-
rule(
|
|
99
|
+
rule(knownParser, 'network-functions', 'NetworkFunctionsConfig', 'NETWORK_FUNCTIONS', 'lint-network-functions', `
|
|
96
100
|
read.csv("https://example.com/data.csv")
|
|
97
101
|
download.file("https://foo.bar")
|
|
98
102
|
`, tagTypes);
|
|
99
|
-
rule(
|
|
103
|
+
rule(knownParser, 'file-path-validity', 'FilePathValidityConfig', 'FILE_PATH_VALIDITY', 'lint-file-path-validity', `
|
|
100
104
|
my_data <- read.csv("C:/Users/me/Documents/My R Scripts/Reproducible.csv")
|
|
101
105
|
`, tagTypes);
|
|
102
|
-
rule(
|
|
106
|
+
rule(knownParser, 'absolute-file-paths', 'AbsoluteFilePathConfig', 'ABSOLUTE_PATH', 'lint-absolute-path', `
|
|
103
107
|
read.csv("C:/Users/me/Documents/My R Scripts/Reproducible.csv")
|
|
104
108
|
`, tagTypes);
|
|
105
|
-
rule(
|
|
109
|
+
rule(knownParser, 'unused-definitions', 'UnusedDefinitionConfig', 'UNUSED_DEFINITION', 'lint-unused-definition', `
|
|
106
110
|
x <- 42
|
|
107
111
|
y <- 3
|
|
108
112
|
print(x)
|
|
109
113
|
`, tagTypes);
|
|
110
|
-
rule(
|
|
111
|
-
rule(
|
|
114
|
+
rule(knownParser, 'seeded-randomness', 'SeededRandomnessConfig', 'SEEDED_RANDOMNESS', 'lint-seeded-randomness', 'runif(1)', tagTypes);
|
|
115
|
+
rule(knownParser, 'naming-convention', 'NamingConventionConfig', 'NAMING_CONVENTION', 'lint-naming-convention', `
|
|
112
116
|
myVar <- 42
|
|
113
117
|
print(myVar)
|
|
114
118
|
`, tagTypes);
|
|
115
|
-
rule(
|
|
119
|
+
rule(knownParser, 'dataframe-access-validation', 'DataFrameAccessValidationConfig', 'DATA_FRAME_ACCESS_VALIDATION', 'lint-dataframe-access-validation', `
|
|
116
120
|
df <- data.frame(id = 1:5, name = 6:10)
|
|
117
121
|
df[6, "value"]
|
|
118
122
|
`, tagTypes);
|
|
119
|
-
rule(
|
|
120
|
-
rule(
|
|
121
|
-
function rule(
|
|
123
|
+
rule(knownParser, 'dead-code', 'DeadCodeConfig', 'DEAD_CODE', 'lint-dead-code', 'if(TRUE) 1 else 2', tagTypes);
|
|
124
|
+
rule(knownParser, 'useless-loop', 'UselessLoopConfig', 'USELESS_LOOP', 'lint-useless-loop', 'for(i in c(1)) { print(i) }', tagTypes);
|
|
125
|
+
function rule(parser, name, configType, ruleType, testfile, example, types) {
|
|
122
126
|
const rule = linter_rules_1.LintingRules[name];
|
|
123
127
|
const tags = rule.info.tags.toSorted((a, b) => {
|
|
124
128
|
// sort but specials first
|
|
@@ -140,7 +144,7 @@ df[6, "value"]
|
|
|
140
144
|
const certaintyText = `\`${(0, html_hover_over_1.textWithTooltip)(rule.info.certainty, certaintyDoc)}\``;
|
|
141
145
|
if (format === 'short') {
|
|
142
146
|
ruleExplanations.set(name, () => Promise.resolve(`
|
|
143
|
-
**[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}
|
|
147
|
+
**[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name))}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
|
|
144
148
|
${tags}
|
|
145
149
|
|
|
146
150
|
`.trim()));
|
|
@@ -148,7 +152,7 @@ df[6, "value"]
|
|
|
148
152
|
else {
|
|
149
153
|
ruleExplanations.set(name, async () => `
|
|
150
154
|
|
|
151
|
-
${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'linter'
|
|
155
|
+
${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'linter' })}
|
|
152
156
|
${(0, doc_structure_1.section)(rule.info.name + ` <sup>[<a href="${doc_files_1.FlowrWikiBaseRef}/Linter">overview</a>]</sup>`, 2, name)}
|
|
153
157
|
|
|
154
158
|
${tags}
|
|
@@ -173,9 +177,9 @@ ${(0, doc_code_1.codeBlock)('r', example)}
|
|
|
173
177
|
|
|
174
178
|
The linting query can be used to run this rule on the above example:
|
|
175
179
|
|
|
176
|
-
${await (0, doc_query_1.showQuery)(
|
|
180
|
+
${await (0, doc_query_1.showQuery)(parser, example, [{ type: 'linter', rules: [{ name, config: {} }] }], { collapseQuery: true })}
|
|
177
181
|
|
|
178
|
-
${buildSamplesFromLinterTestCases(
|
|
182
|
+
${buildSamplesFromLinterTestCases(parser, `${testfile}.test.ts`)}
|
|
179
183
|
|
|
180
184
|
`.trim());
|
|
181
185
|
}
|
|
@@ -189,19 +193,18 @@ function getAllLintingRulesWitCertainty(certainty) {
|
|
|
189
193
|
return Object.entries(linter_rules_1.LintingRules).filter(([_, rule]) => rule.info.certainty === certainty).map(([name]) => name);
|
|
190
194
|
}
|
|
191
195
|
function linkToRule(name) {
|
|
192
|
-
return `[${name}](${doc_files_1.FlowrWikiBaseRef}
|
|
196
|
+
return `[${name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name).replaceAll(' ', '-'))})`;
|
|
193
197
|
}
|
|
194
|
-
async function getTextMainPage(
|
|
195
|
-
const rules = registerRules(
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
+
async function getTextMainPage(knownParser, tagTypes) {
|
|
199
|
+
const rules = registerRules(knownParser, tagTypes.info);
|
|
200
|
+
return `
|
|
198
201
|
This page describes the flowR linter, which is a tool that utilizes flowR's dataflow analysis to find common issues in R scripts. The linter can currently be used through the linter [query](${doc_files_1.FlowrWikiBaseRef}/Query%20API).
|
|
199
202
|
For example:
|
|
200
203
|
|
|
201
204
|
${await (async () => {
|
|
202
205
|
const code = 'read.csv("/root/x.txt")';
|
|
203
|
-
const res = await (0, doc_query_1.showQuery)(
|
|
204
|
-
return await (0, doc_repl_1.documentReplSession)(
|
|
206
|
+
const res = await (0, doc_query_1.showQuery)(knownParser, code, [{ type: 'linter' }], { showCode: false, collapseQuery: true, collapseResult: false });
|
|
207
|
+
return await (0, doc_repl_1.documentReplSession)(knownParser, [{
|
|
205
208
|
command: `:query @linter ${JSON.stringify(code)}`,
|
|
206
209
|
description: `
|
|
207
210
|
The linter will analyze the code and return any issues found.
|
|
@@ -256,42 +259,43 @@ ${Object.entries(linter_format_1.LintingResultCertainty).map(([name, certainty])
|
|
|
256
259
|
|
|
257
260
|
`.trim();
|
|
258
261
|
}
|
|
259
|
-
async function getRulesPages(
|
|
260
|
-
const rules = registerRules(
|
|
262
|
+
async function getRulesPages(knownParser, tagTypes) {
|
|
263
|
+
const rules = registerRules(knownParser, tagTypes.info, 'long');
|
|
261
264
|
const result = {};
|
|
262
265
|
for (const [name, rule] of rules) {
|
|
263
|
-
const filepath = path_1.default.
|
|
266
|
+
const filepath = path_1.default.join('wiki', `${getPageNameForLintingRule(name)}.md`);
|
|
264
267
|
result[filepath] = await rule();
|
|
265
268
|
}
|
|
266
269
|
return result;
|
|
267
270
|
}
|
|
268
271
|
/** Maps file-names to their content, the 'main' file is named 'main' */
|
|
269
|
-
async function getTexts(
|
|
270
|
-
const rVersion = (await shell.usedRVersion())?.format() ?? 'unknown';
|
|
272
|
+
async function getTexts(parser) {
|
|
271
273
|
const tagTypes = (0, doc_types_1.getTypesFromFolder)({
|
|
272
274
|
rootFolder: path_1.default.resolve('./src/linter/'),
|
|
273
275
|
inlineTypes: doc_types_1.mermaidHide
|
|
274
276
|
});
|
|
275
277
|
return {
|
|
276
|
-
'main': await getTextMainPage(
|
|
277
|
-
...await getRulesPages(
|
|
278
|
+
'main': await getTextMainPage(parser, tagTypes),
|
|
279
|
+
...await getRulesPages(parser, tagTypes)
|
|
278
280
|
};
|
|
279
281
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
282
|
+
/**
|
|
283
|
+
* https://github.com/flowr-analysis/flowr/wiki/Linter
|
|
284
|
+
*/
|
|
285
|
+
class WikiLinter extends doc_maker_1.DocMaker {
|
|
286
|
+
constructor() {
|
|
287
|
+
super('wiki/Linter.md', module.filename, 'linter');
|
|
288
|
+
}
|
|
289
|
+
async text({ treeSitter }) {
|
|
290
|
+
const texts = await getTexts(treeSitter);
|
|
291
|
+
for (const [file, content] of Object.entries(texts)) {
|
|
287
292
|
if (file === 'main') {
|
|
288
|
-
continue; // main is printed
|
|
293
|
+
continue; // main is printed below
|
|
289
294
|
}
|
|
290
|
-
|
|
291
|
-
(0, doc_print_1.writeWikiTo)(content, filepath);
|
|
295
|
+
this.writeSubFile(file, content);
|
|
292
296
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}));
|
|
297
|
+
return texts['main'];
|
|
298
|
+
}
|
|
296
299
|
}
|
|
297
|
-
|
|
300
|
+
exports.WikiLinter = WikiLinter;
|
|
301
|
+
//# sourceMappingURL=wiki-linter.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocMakerArgs } from './wiki-mk/doc-maker';
|
|
2
|
+
import { DocMaker } from './wiki-mk/doc-maker';
|
|
3
|
+
/**
|
|
4
|
+
* https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing
|
|
5
|
+
*/
|
|
6
|
+
export declare class WikiLintingAndTesting extends DocMaker {
|
|
7
|
+
constructor();
|
|
8
|
+
protected text({ ctx }: DocMakerArgs): string;
|
|
9
|
+
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
const
|
|
3
|
+
exports.WikiLintingAndTesting = void 0;
|
|
4
|
+
const log_1 = require("../util/log");
|
|
8
5
|
const doc_code_1 = require("./doc-util/doc-code");
|
|
9
6
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
10
7
|
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
11
|
-
const doc_types_1 = require("./doc-util/doc-types");
|
|
12
|
-
const path_1 = __importDefault(require("path"));
|
|
13
|
-
const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
|
|
14
8
|
const doc_cli_option_1 = require("./doc-util/doc-cli-option");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
10
|
+
/**
|
|
11
|
+
* https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing
|
|
12
|
+
*/
|
|
13
|
+
class WikiLintingAndTesting extends doc_maker_1.DocMaker {
|
|
14
|
+
constructor() {
|
|
15
|
+
super('wiki/Linting and Testing.md', module.filename, 'linting and testing definitions');
|
|
16
|
+
}
|
|
17
|
+
text({ ctx }) {
|
|
18
|
+
return `
|
|
24
19
|
For the latest code coverage information, see [codecov.io](${doc_files_1.FlowrCodecovRef}),
|
|
25
20
|
for the latest benchmark results, see the [benchmark results](${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark) wiki page.
|
|
26
21
|
|
|
@@ -92,13 +87,13 @@ This folder contains three special and important elements:
|
|
|
92
87
|
- \`test-summary.ts\` which may produce a summary of the covered capabilities.
|
|
93
88
|
|
|
94
89
|
${(0, doc_structure_1.block)({
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
type: 'WARNING',
|
|
91
|
+
content: `
|
|
97
92
|
We name all test files using the \`.test.ts\` suffix and try to run them in parallel.
|
|
98
|
-
Whenever this is impossible (e.g., when using ${
|
|
93
|
+
Whenever this is impossible (e.g., when using ${ctx.link('withShell')}), please use _\`describe.sequential\`_
|
|
99
94
|
to disable parallel execution for the respective test (otherwise, such tests are flaky).
|
|
100
95
|
`
|
|
101
|
-
|
|
96
|
+
})}
|
|
102
97
|
|
|
103
98
|
<a id='test-labels'></a>
|
|
104
99
|
#### 🏷️ Test Labels
|
|
@@ -128,13 +123,13 @@ assertDataflow(label('simple variable', ['name-normal']), shell,
|
|
|
128
123
|
'x', emptyGraph().use('0', 'x')
|
|
129
124
|
);
|
|
130
125
|
`)}
|
|
131
|
-
Have a look at ${
|
|
126
|
+
Have a look at ${ctx.link('assertDataflow')}, ${ctx.link('label')}, and ${ctx.link('emptyGraph')} for more information.
|
|
132
127
|
|
|
133
128
|
When writing dataflow tests, additional settings can be used to reduce the amount of graph data that needs to be pre-written. Notably:
|
|
134
129
|
|
|
135
|
-
- ${
|
|
130
|
+
- ${ctx.link('expectIsSubgraph')} indicates that the expected graph is a subgraph, rather than the full graph that the test should generate.
|
|
136
131
|
The test will then only check if the supplied graph is contained in the result graph, rather than an exact match.
|
|
137
|
-
- ${
|
|
132
|
+
- ${ctx.link('resolveIdsAsCriterion')} indicates that the ids given in the expected (sub)graph should be resolved as [slicing criteria](${doc_files_1.FlowrWikiBaseRef}/Terminology#slicing-criterion) rather than actual ids.
|
|
138
133
|
For example, passing \`12@a\` as an id in the expected (sub)graph will cause it to be resolved as the corresponding id.
|
|
139
134
|
|
|
140
135
|
The following example shows both in use:
|
|
@@ -265,15 +260,13 @@ You can also set the \`Auto Attach Filter\` setting to automatically attach the
|
|
|
265
260
|
### Logging
|
|
266
261
|
|
|
267
262
|
*flowR* uses a wrapper around [tslog](https://www.npmjs.com/package/tslog) using a class named
|
|
268
|
-
${
|
|
263
|
+
${ctx.link(log_1.FlowrLogger)}. They obey to, for example, the ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'verbose')}
|
|
269
264
|
option. Throughout *flowR*, we use the \`log\` object (or subloggers of it) for logging.
|
|
270
|
-
To create your own logger, you can use ${
|
|
271
|
-
For example, check out the ${
|
|
265
|
+
To create your own logger, you can use ${ctx.linkM(log_1.FlowrLogger, 'getSubLogger', { codeFont: true, realNameWrapper: 'i' })}.
|
|
266
|
+
For example, check out the ${ctx.link('slicerLogger')} for the static slicer.
|
|
272
267
|
|
|
273
268
|
`;
|
|
269
|
+
}
|
|
274
270
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
console.log(getText());
|
|
278
|
-
}
|
|
279
|
-
//# sourceMappingURL=print-linting-and-testing-wiki.js.map
|
|
271
|
+
exports.WikiLintingAndTesting = WikiLintingAndTesting;
|
|
272
|
+
//# sourceMappingURL=wiki-linting-and-testing.js.map
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { FnElementInfo, PrintHierarchyArguments, TypeElementKind } from '../doc-util/doc-types';
|
|
2
|
+
import type { RShell } from '../../r-bridge/shell';
|
|
3
|
+
/**
|
|
4
|
+
* Context available when generating documentation for a wiki in markdown format
|
|
5
|
+
*/
|
|
6
|
+
export interface ElementFilter {
|
|
7
|
+
/** In case names collide, you can use this to further distinguish between them */
|
|
8
|
+
readonly file?: RegExp;
|
|
9
|
+
/** In case names collide, you can use this to further distinguish between them, by specifying the kind you search for */
|
|
10
|
+
readonly type?: TypeElementKind;
|
|
11
|
+
/** Whether to use fuzzy matching for the element name */
|
|
12
|
+
readonly fuzzy?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Formatting options for links to code elements
|
|
16
|
+
*/
|
|
17
|
+
export interface LinkFormat {
|
|
18
|
+
/**
|
|
19
|
+
* Whether to use md code font for the link text
|
|
20
|
+
*/
|
|
21
|
+
codeFont?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Wrapper for the real name (if specified), e.g., to italicize or bold it
|
|
24
|
+
*/
|
|
25
|
+
realNameWrapper?: 'i' | 'b';
|
|
26
|
+
}
|
|
27
|
+
export type ElementId = string;
|
|
28
|
+
export type ElementIdOrRef = ElementId | {
|
|
29
|
+
name: string;
|
|
30
|
+
} | (new () => unknown);
|
|
31
|
+
type NamedPrototype = {
|
|
32
|
+
prototype: {
|
|
33
|
+
constructor: {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type ProtoKeys<T> = T extends {
|
|
39
|
+
prototype: infer P;
|
|
40
|
+
} ? keyof P : never;
|
|
41
|
+
/**
|
|
42
|
+
* Provides methods to generate links, code snippets, and documentation for code elements.
|
|
43
|
+
* These wrap around a collection of useful helpers originating from the doc utils.
|
|
44
|
+
* To create an instance, use {@link makeDocContextForTypes} (although if you are writing a wiki, you get such an instance).
|
|
45
|
+
*/
|
|
46
|
+
export interface GeneralDocContext {
|
|
47
|
+
/**
|
|
48
|
+
* Generate a hyperlink to a code element in the wiki.
|
|
49
|
+
* If you want to reference the member of a class, use `ClassName::MemberName` as element name.
|
|
50
|
+
* For ease of use, you can also call {@link GeneralDocContext#linkM|linkM} to create a link to a member.
|
|
51
|
+
* @param element - The element to create a link for, the name can be qualified with `::` to specify the class.
|
|
52
|
+
* This causes the link to be usually printed as `ClassName::ElementName`. If you want to avoid showing
|
|
53
|
+
* the class name, use `:::` as separator. Please note that for elements with a sensible (`.name`),
|
|
54
|
+
* you can also pass the function/constructor reference directly (e.g., `link(MyClass)`).
|
|
55
|
+
* @param fmt - Formatting options for the link (see {@link LinkFormat})
|
|
56
|
+
* @param filter - An optional filter to further specify the element to link to, in case multiple elements with the same name exist.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* link(registerPluginMaker.name)
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* Creates a (markdown) link to the `registerPluginMaker` function in the code base
|
|
63
|
+
* and, if available, attaches the TS documentation as tooltip.
|
|
64
|
+
* By using the `.name`, the link text will be `registerPluginMaker` but respect, e.g., renaming refactorings done in the code base.
|
|
65
|
+
* @see {@link linkFile} - to create a link using the file path as name.
|
|
66
|
+
* @see {@link shortLink} - for the underlying impl.
|
|
67
|
+
* @see {@link dropGenericsFromTypeName} - to clean up type names for display.
|
|
68
|
+
*/
|
|
69
|
+
link(element: ElementIdOrRef, fmt?: LinkFormat, filter?: ElementFilter): string;
|
|
70
|
+
/**
|
|
71
|
+
* Generate a hyperlink to a member of a class in the wiki.
|
|
72
|
+
* This is a convenience method around {@link GeneralDocContext#link|link}.
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* linkM(MyClass, 'myMethod')
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* Creates a (markdown) link to the `myMethod` member of the `MyClass` class in the code base.
|
|
79
|
+
* @see {@link GeneralWikiContext#link|link} - for the underlying impl.
|
|
80
|
+
*/
|
|
81
|
+
linkM<T extends NamedPrototype>(cls: T, element: ProtoKeys<T>, fmt?: LinkFormat & {
|
|
82
|
+
hideClass?: boolean;
|
|
83
|
+
}, filter?: ElementFilter): string;
|
|
84
|
+
/**
|
|
85
|
+
* Generate a hyperlink to a type/element definition in the code base which is displayed using the file path as name
|
|
86
|
+
* @param element - The element to create a link for, the name can be qualified with `::` to specify the class.
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* linkFile(registerPluginMaker.name)
|
|
90
|
+
* ```
|
|
91
|
+
* Creates a (markdown) link to the `registerPluginMaker` function in the code base
|
|
92
|
+
* using the file path as link name.
|
|
93
|
+
* @see {@link GeneralWikiContext#link|link} - to create a link with a custom name/using the type name by default.
|
|
94
|
+
* @see {@link linkFile} - for the underlying impl.
|
|
95
|
+
*/
|
|
96
|
+
linkFile(element: ElementIdOrRef): string;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the documentation for a code element as markdown string.
|
|
99
|
+
* If you want to, e.g., prefix all of these lines with indentation or `> ` for blockquotes,
|
|
100
|
+
* use {@link prefixLines}.
|
|
101
|
+
* @param element - The element to create documentation for, the name can be qualified with `::` to specify the class.
|
|
102
|
+
* @param filter - An optional filter to further specify the element to get the documentation for, in case multiple elements with the same name exist.
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* doc(exampleFn.name)
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* Creates the documentation for the `exampleFn` function in the code base as markdown string.
|
|
109
|
+
* @see {@link getDocumentationForType} - for the underlying impl.
|
|
110
|
+
* @see {@link removeCommentSymbolsFromTypeScriptComment} - to clean up TS doc comments.
|
|
111
|
+
*/
|
|
112
|
+
doc(element: ElementIdOrRef, filter?: Omit<ElementFilter, 'file'>): string;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the code snippet for a code element as markdown string.
|
|
115
|
+
* @param element - The element to create a code snippet for, the name can be qualified with `::` to specify the class.
|
|
116
|
+
* @param fmt - Formatting options for the code snippet (see {@link FnElementInfo})
|
|
117
|
+
* @param filter - An optional filter to further specify the element to get the code for, in case multiple elements with the same name exist.
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* code(exampleFn.name, { dropLinesStart: 1, dropLinesEnd: 2 })
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* Creates a code snippet for the `exampleFn` function in the code base,
|
|
124
|
+
* dropping the first and last two lines of the function definition.
|
|
125
|
+
* If, for example, the function looks like this:
|
|
126
|
+
*
|
|
127
|
+
* ```ts
|
|
128
|
+
* function exampleFn(a: number, b: number): number {
|
|
129
|
+
* // This is an example
|
|
130
|
+
* const result = a + b;
|
|
131
|
+
* return result;
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* The resulting code snippet will be (auto-gobbled by default):
|
|
136
|
+
*
|
|
137
|
+
* ```ts
|
|
138
|
+
* // This is an example
|
|
139
|
+
* const result = a + b;
|
|
140
|
+
* ```
|
|
141
|
+
* @see {@link printCodeOfElement} - for the underlying impl.
|
|
142
|
+
*/
|
|
143
|
+
code(element: ElementIdOrRef, fmt?: Omit<FnElementInfo, 'info' | 'program'>, filter?: ElementFilter): string;
|
|
144
|
+
/**
|
|
145
|
+
* Returns the hierarchy (e.g., class inheritance) for a code element as markdown string,
|
|
146
|
+
* including their documentation and snippets.
|
|
147
|
+
* @param element - The element to create a hierarchy for, the name can be qualified with `::` to specify the class.
|
|
148
|
+
* @param fmt - Formatting options for the hierarchy (see {@link PrintHierarchyArguments})
|
|
149
|
+
* @param filter - An optional filter to further specify the element to get the hierarchy for, in case multiple elements with the same name exist.
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* hierarchy(MyClass.name, { maxDepth: 2 })
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* Creates the hierarchy for the `MyClass` class in the code base,
|
|
156
|
+
* including up to two levels of inheritance.
|
|
157
|
+
* @see {@link printHierarchy} - for the underlying impl.
|
|
158
|
+
*/
|
|
159
|
+
hierarchy(element: ElementIdOrRef, fmt?: Omit<PrintHierarchyArguments, 'info' | 'program' | 'root'>, filter?: ElementFilter): string;
|
|
160
|
+
/**
|
|
161
|
+
* Generates an auto-generation header for the wiki page.
|
|
162
|
+
* @param filename - The name of the file being generated. Probably use `module.filename`.
|
|
163
|
+
* @param purpose - The purpose of the file, e.g., 'wiki context for types'.
|
|
164
|
+
*/
|
|
165
|
+
header(filename: string, purpose: string): Promise<string>;
|
|
166
|
+
/**
|
|
167
|
+
* Generates a mermaid diagram for the given code element, returned as markdown string.
|
|
168
|
+
* @param element - The element to create a mermaid diagram for, the name can be qualified with `::` to specify the class.
|
|
169
|
+
* @param inlineTypes - Optional list of type names to inline in the mermaid diagram (instead of linking them out).
|
|
170
|
+
*/
|
|
171
|
+
mermaid(element: ElementIdOrRef, inlineTypes?: string[]): string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Creates a wiki context for generating documentation for code elements.
|
|
175
|
+
* This context provides methods to create links, code snippets, and documentation for code elements.
|
|
176
|
+
* @param shell - An optional RShell instance to retrieve the R version for the auto-generation header.
|
|
177
|
+
* @param rootFolders - The root folder(s) of the code base to analyze. Defaults to flower's `src/` **and** `test/` folder.
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const ctx = makeContextForTypes();
|
|
181
|
+
* const linkToFn = ctx.link('myFunction');
|
|
182
|
+
* const fnDoc = ctx.doc('myFunction');
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
export declare function makeDocContextForTypes(shell?: RShell, ...rootFolders: string[]): GeneralDocContext;
|
|
186
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.makeDocContextForTypes = makeDocContextForTypes;
|
|
7
|
+
const doc_types_1 = require("../doc-util/doc-types");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const assert_1 = require("../../util/assert");
|
|
10
|
+
const doc_auto_gen_1 = require("../doc-util/doc-auto-gen");
|
|
11
|
+
function getNameFromElementIdOrRef(element) {
|
|
12
|
+
if (typeof element === 'function') {
|
|
13
|
+
return element.name;
|
|
14
|
+
}
|
|
15
|
+
else if (typeof element === 'object' && 'name' in element) {
|
|
16
|
+
return element.name;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return element;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a wiki context for generating documentation for code elements.
|
|
24
|
+
* This context provides methods to create links, code snippets, and documentation for code elements.
|
|
25
|
+
* @param shell - An optional RShell instance to retrieve the R version for the auto-generation header.
|
|
26
|
+
* @param rootFolders - The root folder(s) of the code base to analyze. Defaults to flower's `src/` **and** `test/` folder.
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const ctx = makeContextForTypes();
|
|
30
|
+
* const linkToFn = ctx.link('myFunction');
|
|
31
|
+
* const fnDoc = ctx.doc('myFunction');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function makeDocContextForTypes(shell, ...rootFolders) {
|
|
35
|
+
if (rootFolders.length === 0) {
|
|
36
|
+
rootFolders.push(path_1.default.resolve(__dirname, '../../../src'));
|
|
37
|
+
rootFolders.push(path_1.default.resolve(__dirname, '../../../test/functionality'));
|
|
38
|
+
}
|
|
39
|
+
const { info, program } = (0, doc_types_1.getTypesFromFolder)({ rootFolder: rootFolders, typeNameForMermaid: undefined });
|
|
40
|
+
return {
|
|
41
|
+
doc(element, filter) {
|
|
42
|
+
return (0, doc_types_1.getDocumentationForType)(getNameFromElementIdOrRef(element), info, '', filter);
|
|
43
|
+
},
|
|
44
|
+
link(element, fmt, filter) {
|
|
45
|
+
(0, assert_1.guard)(filter === undefined, 'ElementFilter is not yet supported for link');
|
|
46
|
+
return (0, doc_types_1.shortLink)(getNameFromElementIdOrRef(element), info, fmt?.codeFont, fmt?.realNameWrapper);
|
|
47
|
+
},
|
|
48
|
+
linkM(cls, element, fmt, filter) {
|
|
49
|
+
const className = cls.prototype.constructor.name;
|
|
50
|
+
const sep = (fmt?.hideClass) ? ':::' : '::';
|
|
51
|
+
const fullName = `${className}${sep}${String(element)}`;
|
|
52
|
+
return this.link(fullName, fmt, filter);
|
|
53
|
+
},
|
|
54
|
+
linkFile(element) {
|
|
55
|
+
return (0, doc_types_1.shortLinkFile)(getNameFromElementIdOrRef(element), info);
|
|
56
|
+
},
|
|
57
|
+
hierarchy(element, fmt, filter) {
|
|
58
|
+
(0, assert_1.guard)(filter === undefined, 'ElementFilter is not yet supported for hierarchy');
|
|
59
|
+
return (0, doc_types_1.printHierarchy)({
|
|
60
|
+
program, info,
|
|
61
|
+
root: getNameFromElementIdOrRef(element),
|
|
62
|
+
...fmt
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
code(element, fmt, filter) {
|
|
66
|
+
(0, assert_1.guard)(filter === undefined, 'ElementFilter is not yet supported for code');
|
|
67
|
+
return (0, doc_types_1.printCodeOfElement)({
|
|
68
|
+
program, info,
|
|
69
|
+
...fmt,
|
|
70
|
+
}, getNameFromElementIdOrRef(element));
|
|
71
|
+
},
|
|
72
|
+
async header(filename, purpose) {
|
|
73
|
+
const rVersion = (await shell?.usedRVersion())?.format();
|
|
74
|
+
return (0, doc_auto_gen_1.autoGenHeader)({ filename, purpose, rVersion });
|
|
75
|
+
},
|
|
76
|
+
mermaid(element, inlineTypes = doc_types_1.mermaidHide) {
|
|
77
|
+
return (0, doc_types_1.visualizeMermaidClassDiagram)(info, {
|
|
78
|
+
typeNameForMermaid: getNameFromElementIdOrRef(element),
|
|
79
|
+
inlineTypes
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=doc-context.js.map
|