@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
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPILED_CODE = void 0;
|
|
4
|
+
const linter_format_1 = require("../../linter-format");
|
|
5
|
+
const flowr_search_builder_1 = require("../../../search/flowr-search-builder");
|
|
6
|
+
const linter_tags_1 = require("../../linter-tags");
|
|
7
|
+
const range_1 = require("../../../util/range");
|
|
8
|
+
const cmd_check_util_1 = require("./cmd-check-util");
|
|
9
|
+
const file_checks_1 = require("./file-checks");
|
|
10
|
+
const flowr_file_1 = require("../../../project/context/flowr-file");
|
|
11
|
+
const package_files_1 = require("./package-files");
|
|
12
|
+
/** the warnings whose pragmas `R CMD check` calls non-portable */
|
|
13
|
+
const NonPortableWarnings = `
|
|
14
|
+
abi-tag aggressive-loop-optimizations aliasing align-commons aligned-new alloc-size-larger-than alloc-zero alloca alloca-larger-than ampersand argument-mismatch array-temporaries assign-intercept attribute-alias bool-compare bool-operation builtin-declaration-mismatch c-binding-type c90-c99-compat c99-c11-compat
|
|
15
|
+
cast-function-type catch-value character-truncation chkp class-memaccess clobbered compare-reals conditionally-supported conversion-extra coverage-mismatch designated-init discarded-array-qualifiers discarded-qualifiers do-subscript duplicated-branches duplicated-cond format-contains-nul format-overflow format-signedness
|
|
16
|
+
format-truncation frame-address frame-larger-than free-nonheap-object function-elimination hsa if-not-aligned implicit-interface implicit-procedure inherited-variadic-ctor int-in-bool-context integer-division intrinsic-shadow intrinsics-std invalid-memory-model jump-misses-init larger-than line-truncation literal-suffix
|
|
17
|
+
logical-op lto-type-mismatch maybe-uninitialized memset-elt-size misleading-indentation missing-attributes missing-parameter-type multiple-inheritance multistatement-macros namespaces noexcept non-template-friend nonnull-compare normalized old-style-declaration openmp-simd override-init override-init-side-effects
|
|
18
|
+
packed-bitfield-compat packed-not-aligned placement-new pmf-conversions pointer-compare property-assign-default psabi real-q-constant realloc-lhs realloc-lhs-all restrict return-local-addr scalar-storage-order shadow-compatible-local shadow-local sized-deallocation sizeof-pointer-div stack-usage strict-null-sentinel
|
|
19
|
+
stringop-overflow stringop-truncation subobject-linkage suggest-attribute suggest-final-methods suggest-final-types suggest-override surprising switch-unreachable sync-nand tabs target-lifetime templates terminate traditional traditional-conversion trampolines undefined-do-loop underflow unsafe-loop-optimizations
|
|
20
|
+
unsuffixed-float-constants unused-but-set-parameter unused-but-set-variable unused-dummy-argument use-without-only useless-cast vector-operation-performance virtual-inheritance virtual-move-assign vla-larger-than zerotrip
|
|
21
|
+
`.split(/\s+/).filter(s => s !== '');
|
|
22
|
+
/** the entry points `R CMD check` reports as non-API (`tools:::nonAPI`) */
|
|
23
|
+
const NonApiEntryPoints = `
|
|
24
|
+
chol_ chol2inv_ cg_ ch_ rg_ fft_factor fft_work Brent_fmin optif0 OBJECT NAMED SET_NAMED IS_S4_OBJECT SET_S4_OBJECT UNSET_S4_OBJECT R_data_class SET_TYPEOF ENVFLAGS SET_ENVFLAGS LEVELS SETLEVELS EXTPTR_PTR ENCLOS DATAPTR Rf_isValidString Rf_isFrame OutDec PRIMOFFSET RC_fopen R_CollectFromIndex R_CompiledFileName R_FileExists
|
|
25
|
+
R_FreeStringBuffer R_FunTab R_GE_setVFontRoutines R_GetVarLocMISSING Rsleep R_MethodsNamespace R_NewHashedEnv R_OpenCompiledFile R_PV R_ParseContext R_ParseContextLast R_ParseContextLine R_ParseError R_ParseErrorMsg R_SrcfileSymbol R_SrcrefSymbol R_Visible R_cairoCdynload R_deferred_default_method R_execMethod
|
|
26
|
+
R_findVarLocInFrame R_fopen R_gc_torture R_get_arith_function R_gzclose R_gzgets R_gzopen R_ignore_SIGPIPE R_isForkedChild R_isMethodsDispatchOn R_moduleCdynload R_primitive_generic R_primitive_methods R_print R_running_as_main_program R_setInternetRoutines R_setLapackRoutines R_setX11Routines R_set_prim_method
|
|
27
|
+
R_set_quick_method_check R_set_standardGeneric_ptr R_strtod4 R_subassign3_dflt R_taskCallbackRoutine Rconn_fgetc Rconn_printf Rdownload Rf_EncodeComplex Rf_EncodeElement Rf_EncodeEnvironment Rf_EncodeInteger Rf_EncodeReal0 Rf_EncodeLogical Rf_EncodeReal Rf_GPretty Rf_NewEnvironment Rf_PrintDefaults Rf_ReplIteration Rf_Seql
|
|
28
|
+
Rf_begincontext Rf_callToplevelHandlers Rf_checkArityCall Rf_con_pushback Rf_copyMostAttribNoTs Rf_deparse1 Rf_deparse1line Rf_dpptr Rf_endcontext Rf_envlength Rf_formatComplex Rf_formatInteger Rf_formatLogical Rf_formatReal Rf_init_con Rf_isProtected Rf_mbrtowc Rf_mkFalse Rf_printNamedVector Rf_printRealVector Rf_printVector
|
|
29
|
+
Rf_set_iconv Rf_sortVector Rf_strIsASCII Rf_strchr Rf_strrchr Rf_ucstomb Rf_utf8towcs Rf_wcstoutf8 Rg_PolledEvents Rg_set_col_ptrs Rf_wait_usec Ri18n_iswctype Ri18n_wcswidth Ri18n_wctype Ri18n_wcwidth Rsockclose Rsockconnect Rsocklisten Rsockopen Rsockread Rsockwrite Runzip UNIMPLEMENTED_TYPE baseRegisterIndex Rf_csduplicated
|
|
30
|
+
Rf_currentTime dcar dcdr do_Rprof do_Rprofmem do_X11 do_contourLines do_edit do_getGraphicsEventEnv do_getSnapshot do_playSnapshot do_saveplot do_set_prim_method dtype dummy_fgetc dummy_ii dummy_vfprintf epslon_ extR_HTTPDCreate extR_HTTPDStop fdhess getConnection getPRIMNAME known_to_be_latin1 locale2charset match5 matherr
|
|
31
|
+
max_contour_segments Rf_mbcsToUcs2 Rf_memtrace_report parseError pythag_ rs_ rwarnc_ tql2_ tqlrat_ tred1_ tred2_ utf8locale yylloc R_opendir R_readdir R_closedir ENSURE_NAMEDMAX IS_ASCII IS_UTF8 AllDevicesKilled R_CStackLimit R_CStackStart R_ClearerrConsole R_CleanTempDir R_Consolefile R_DefCallbacks R_DefParams R_DefParamsEx
|
|
32
|
+
R_DirtyImage R_GUIType R_GlobalContext R_HistoryFile R_HistorySize R_Home R_HomeDir R_Interactive R_Outputfile R_PolledEvents R_ReplDLLdo1 R_ReplDLLinit R_RestoreGlobalEnv R_RestoreGlobalEnvFromFile R_RestoreHistory R_RunExitFinalizers R_SaveGlobalEnv R_SaveGlobalEnvToFile R_SelectEx R_SetParams R_SetWin32 R_SignalHandlers
|
|
33
|
+
R_SizeFromEnv R_NoEcho R_Suicide R_TempDir R_checkActivity R_checkActivityEx R_runHandlers R_setStartTime R_set_command_line_arguments R_setupHistory R_timeout_handler R_timeout_val R_wait_usec SaveAction RestoreAction Rf_CleanEd Rf_KillAllDevices Rf_endEmbeddedR Rf_initEmbeddedR Rf_initialize_R Rf_jump_to_toplevel Rf_mainloop
|
|
34
|
+
editorcleanall fpu_setup freeRUser free_R_HOME getDLLVersion getRUser get_R_HOME getSelectedHandler initStdinHandler process_site_Renviron process_system_Renviron process_user_Renviron ptr_R_Busy ptr_R_ChooseFile ptr_R_CleanUp ptr_R_ClearerrConsole ptr_R_EditFile ptr_R_EditFiles ptr_R_FlushConsole ptr_R_ProcessEvents
|
|
35
|
+
ptr_R_ReadConsole ptr_R_ResetConsole ptr_R_ShowFiles ptr_R_ShowMessage ptr_R_Suicide ptr_R_WriteConsole ptr_R_WriteConsoleEx ptr_R_addhistory ptr_R_loadhistory ptr_R_savehistory ptr_do_dataentry ptr_do_dataviewer ptr_do_selectlist readconsolecfg run_Rmainloop setup_Rmainloop R_NamespaceRegistry R_InBCInterpreter
|
|
36
|
+
R_CurrentExpression R_CStackDir R_MB_CUR_MAX R_compact_intseq_class R_compact_realseq_class R_num_math_threads R_max_num_math_threads R_FalseValue R_LogicalNAValue R_TrueValue call_R Rf_setSVector Rf_asRbool Rf_asBool2 R_BadLongVector REFCNT ALTREP_LENGTH ALTVEC_DATAPTR ALTVEC_DATAPTR_RO ALTSTRING_ELT R_signal_protect_error
|
|
37
|
+
R_signal_unprotect_error R_signal_reprotect_error Rf_allocVector3 R_typeToChar Rf_translateCharFP Rstrdup Rf_matchE R_popen R_system R_findVarLoc R_duplicate_attr Rf_substitute Rf_type2rstr R_MissingArgError R_MissingArgError_c R_makePartialMatchWarningCondition Rf_EncodeChar Rf_utf8clen R_strtod5 Rf_utf8toucs Rf_wtransChar
|
|
38
|
+
Rf_mbcsValid Rf_utf8Valid SET_OBJECT SET_PRENV SET_PRVALUE SET_PRCODE R_PromiseExpr DDVAL INTERNAL SYMVALUE INTEGER0 LOGICAL0 RAW0 REAL0 COMPLEX0 RDEBUG SET_RDEBUG STRING_PTR Rf_findVar Rf_findVarInFrame Rf_findVarInFrame3 PRCODE PRENV PRVALUE XLENGTH_EX Rf_gsetVar R_lsInternal Rf_allocSExp BODY FORMALS CLOENV ATTRIB
|
|
39
|
+
SET_ATTRIB R_asHashtable R_HashtabSEXP R_isHashtable R_mkhashtab R_gethash R_sethash R_remhash R_numhash R_typhash R_maphash R_maphashC R_clrhash R_Pretty
|
|
40
|
+
`.split(/\s+/).filter(s => s !== '');
|
|
41
|
+
const Prefixes = 'CPP|C|CXX|CXX98|CXX11|CXX14|CXX17|CXX20|CXX23|F|FC|OBJC|OBJCXX';
|
|
42
|
+
const MakeFile = /^src\/(?:.*\/)?(?:Makevars|Makevars\.in|Makefile|Makefile\.in)$|(?:^|\/)Makefile$/;
|
|
43
|
+
const MakevarsFile = /^src\/Makevars(?:\.in)?$/;
|
|
44
|
+
const FlagFile = /^src\/(?:Makevars(?:\.in|\.win|\.ucrt)?|Makefile(?:\.win|\.ucrt)?)$/;
|
|
45
|
+
const CFamily = /^src\/.*\.(?:c|cc|cpp|cxx|C|h|hh|hpp|hxx)$/;
|
|
46
|
+
const CSource = /^src\/.*\.(?:c|cc|cpp|cxx|C)$/;
|
|
47
|
+
const FortranSrc = /^src\/[^/]*\.(?:f|f90|f95)$/;
|
|
48
|
+
const KindDeclaration = /[(].*(kind|KIND) *= *[1-9].*[)]/;
|
|
49
|
+
const GnuExtension = /(?:[+]=|:=|[$][(](?:wildcard|shell|eval|call|patsubst)|^ifeq|^ifneq|^ifdef|^ifndef|^endifi|[.]NOTPARALLEL)/;
|
|
50
|
+
const FortranComment = /^(?:[cC]| *!)/;
|
|
51
|
+
const Include = /^\s*#\s*include\s*[<"]([^>"]+)[>"]/;
|
|
52
|
+
const UsesR = /^\s*#\s*include\s*[<"](?:R\w*\.h|(?:R_ext\/|Rcpp|cpp11)[^>"]*)[>"]|\bRcpp\b|\bcpp11\b/m;
|
|
53
|
+
const Declarators = new Set(['return', 'else', 'case', 'throw', 'sizeof', 'do', 'goto', 'co_return', 'co_yield', 'new', 'delete', 'and', 'or', 'not']);
|
|
54
|
+
const Lead = String.raw `^\s*(?:\d+\s+)?(?:if\s*\(.*\)\s*)?`;
|
|
55
|
+
const FortranStatements = Object.entries({
|
|
56
|
+
print: `${Lead}print\\b`, write: `${Lead}write\\s*\\(`, read: `${Lead}read\\s*[(*]`, open: `${Lead}open\\s*\\(`, close: `${Lead}close\\s*\\(`, rewind: `${Lead}rewind\\b`, stop: `${Lead}stop\\b`,
|
|
57
|
+
exit: String.raw `\bcall\s+exit\s*\(`, rand: String.raw `\bcall\s+rand\b|(?<![\w%])rand\s*\(`, random_number: String.raw `\bcall\s+random_number\b`,
|
|
58
|
+
random_seed: String.raw `\bcall\s+random_seed\b`, random_init: String.raw `\bcall\s+random_init\b`
|
|
59
|
+
}).map(([name, pattern]) => [name, new RegExp(pattern, 'i')]);
|
|
60
|
+
const Categories = [
|
|
61
|
+
[/^(abort|exit|_exit|_Exit|stop)$/, 'might terminate R'],
|
|
62
|
+
[/^(rand|random|rand_r|srand|srandom|srandom_r|srand48|random_number|random_seed|random_init)$/, 'uses the system RNG'],
|
|
63
|
+
[/^v?sprintf$/, 'uses [v]sprintf'],
|
|
64
|
+
[/^(read|write|print|open|close|rewind)$/, 'uses Fortran I/O']
|
|
65
|
+
];
|
|
66
|
+
function logicalLines(text) {
|
|
67
|
+
const raw = text.split(/\r?\n/);
|
|
68
|
+
const result = [];
|
|
69
|
+
for (let i = 0; i < raw.length; i++) {
|
|
70
|
+
const line = i + 1;
|
|
71
|
+
let t = raw[i];
|
|
72
|
+
while (t.endsWith('\\') && i + 1 < raw.length) {
|
|
73
|
+
t = t.slice(0, -1) + ' ' + raw[++i];
|
|
74
|
+
}
|
|
75
|
+
result.push({ text: t.replace(/#.*/, ''), line });
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
const CSyntax = /\/\/(?:\\\n|[^\n])*|\/\*[\s\S]*?(?:\*\/|$)|(?<=R)"([^()\\\s]{0,16})\([\s\S]*?(?:\)\1"|$)|"(?:\\[\s\S]|[^"\\\n])*"?|(?<!\w)'(?:\\[\s\S]|[^'\\\n])*'?/g;
|
|
80
|
+
const blank = (s) => s.replace(/[^\n]/g, ' ');
|
|
81
|
+
/** blanks the comments (and optionally the string and character literals) of C/C++ code, keeping every line break */
|
|
82
|
+
function stripC(text, strings) {
|
|
83
|
+
return text.replace(CSyntax, m => m.startsWith('/') || strings ? blank(m) : m);
|
|
84
|
+
}
|
|
85
|
+
const escapeRegex = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
86
|
+
const alt = (names) => names.length === 0 ? '(?!)' : `(?:${names.map(escapeRegex).join('|')})`;
|
|
87
|
+
const category = (symbol) => Categories.find(([p]) => p.test(symbol))?.[1] ?? 'writes to stdout/stderr instead of to the console';
|
|
88
|
+
function scan(files, rules, add) {
|
|
89
|
+
for (const r of rules.filter(r => r.when !== false)) {
|
|
90
|
+
const re = r.line;
|
|
91
|
+
const test = typeof re === 'function' ? re : (l) => {
|
|
92
|
+
const m = re.exec(l);
|
|
93
|
+
return m ? [m] : false;
|
|
94
|
+
};
|
|
95
|
+
for (const e of files.entries.filter(e => !e.isDirectory && r.files.test(e.relative))) {
|
|
96
|
+
const raw = files.read(e.relative) ?? '';
|
|
97
|
+
const text = r.prep?.(raw) ?? raw;
|
|
98
|
+
const lines = r.gate && !r.gate(text) ? [] : r.logical ? logicalLines(text) : text.split(/\r?\n/).map((t, i) => ({ text: t, line: i + 1 }));
|
|
99
|
+
lines.some(({ text: l, line }) => {
|
|
100
|
+
const hits = test(l, e.relative);
|
|
101
|
+
const found = (hits === true ? [[]] : hits || []).map(h => typeof r.message === 'string' ? r.message : r.message(e.relative, l, h)).filter(m => m !== undefined);
|
|
102
|
+
found.forEach(m => add(r.kind, e.relative, line, m, r.uncertain));
|
|
103
|
+
return r.once && found.length > 0;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const LineEndings = [
|
|
109
|
+
{ kind: 'line endings in shell scripts', files: /^(?:configure|configure\.in|configure\.ac|cleanup)$/, what: 'a shell script', unix: 'Non-Windows OSes', eol: undefined },
|
|
110
|
+
{ kind: 'line endings in C/C++/Fortran sources/headers', files: /^(?:src\/(?![Ww]in)|inst\/include\/).*\.(?:[cfh]|cc|cpp|hpp)$/, what: 'a source/header', unix: 'Some Unix compilers', eol: 'nonEmpty' },
|
|
111
|
+
{ kind: 'line endings in Makefiles', files: MakeFile, what: 'a Makefile', unix: 'Some Unix \'make\' programs', eol: 'always' }
|
|
112
|
+
];
|
|
113
|
+
function checkLineEndings(files, add) {
|
|
114
|
+
for (const { kind, files: pattern, what, unix, eol } of LineEndings) {
|
|
115
|
+
for (const e of files.entries.filter(e => !e.isDirectory && pattern.test(e.relative))) {
|
|
116
|
+
const content = files.read(e.relative) ?? '';
|
|
117
|
+
const cr = content.indexOf('\r');
|
|
118
|
+
if (cr !== -1) {
|
|
119
|
+
add(kind, e.relative, content.slice(0, cr).split('\n').length, `Found ${what} with CR or CRLF line endings. ${unix} require LF line endings.`);
|
|
120
|
+
}
|
|
121
|
+
else if (eol && !content.endsWith('\n') && (content !== '' || eol === 'always')) {
|
|
122
|
+
add(kind, e.relative, content.split('\n').length, `Found ${what} not terminated with a newline. ${unix} may mishandle such files.`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** the variables of the Makevars, with the variables defined in the file expanded (unknown ones are empty, like `R` evaluates the file) */
|
|
128
|
+
function checkMakevars(files, isBad, add) {
|
|
129
|
+
const main = ['src/Makevars.in', 'src/Makevars'].find(f => files.read(f) !== undefined);
|
|
130
|
+
const vars = new Map();
|
|
131
|
+
for (const { text, line } of logicalLines(files.read(main ?? '') ?? '')) {
|
|
132
|
+
const m = /^\s*(?:(?:override|export)\s+)?([A-Za-z_][\w.]*)\s*(\+=|:?:?=|\?=)\s*(.*?)\s*$/.exec(text);
|
|
133
|
+
const old = m ? vars.get(m[1])?.value : undefined;
|
|
134
|
+
if (m) {
|
|
135
|
+
vars.set(m[1], { line, value: m[2] === '+=' ? `${old ?? ''} ${m[3]}`.trim() : m[2] === '?=' ? old ?? m[3] : m[3] });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const expand = (value, depth = 0) => depth > 8 ? value : value.replace(/\$[({]([\w.]+)[)}]|\$(\w)/g, (_, a, b) => expand(vars.get(a ?? b ?? '')?.value ?? '', depth + 1));
|
|
139
|
+
for (const [name, { value, line }] of vars) {
|
|
140
|
+
const m = new RegExp(`^(PKG_)?(?:${Prefixes})FLAGS$`).exec(name);
|
|
141
|
+
const expanded = m ? expand(value) : '';
|
|
142
|
+
const flags = expanded.split(/\s+/).filter(f => isBad(f) && !(/^PKG_FC?FLAGS$/.test(name) && f.startsWith('-std=f')));
|
|
143
|
+
const message = m?.[1] ? flags.length > 0 && `Non-portable flags in variable '${name}': ${flags.join(' ')}`
|
|
144
|
+
: m && expanded !== '-o /dev/null' && `Variables overriding user/site settings: ${name}: ${expanded}`;
|
|
145
|
+
if (message) {
|
|
146
|
+
add('compilation flags in Makevars', main ?? '', line, message);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function checkOpenMp(files, have, add) {
|
|
151
|
+
const languages = [['C', have.c, 'C'], ['CXX', have.cxx, 'C++'], ['F', have.f || have.f9x, 'Fortran'], ['FC', true, '']];
|
|
152
|
+
const cOrCxx = have.cxx ? 'CXXFLAGS' : 'CFLAGS';
|
|
153
|
+
for (const { relative: file } of files.entries.filter(e => !e.isDirectory && FlagFile.test(e.relative))) {
|
|
154
|
+
const all = logicalLines(files.read(file) ?? '').filter(l => l.text !== '');
|
|
155
|
+
const libs = all.filter(l => /^[ \t]*PKG_LIBS/.test(l.text));
|
|
156
|
+
const find = (p, from = all) => from.find(l => p.test(l.text));
|
|
157
|
+
const inLibs = (macro) => libs.find(l => l.text.includes(`SHLIB_OPENMP_${macro}`));
|
|
158
|
+
const note = (line, msg) => add('use of SHLIB_OPENMP_*FLAGS in Makefiles', file, line ?? 1, msg);
|
|
159
|
+
const useFc = all.some(l => l.text.startsWith('USE_FC_TO_LINK'));
|
|
160
|
+
const used = [];
|
|
161
|
+
for (const [f, present, lang] of languages) {
|
|
162
|
+
const flags = `${f}FLAGS`;
|
|
163
|
+
const hit = find(new RegExp(`^[ \\t]*PKG_${flags}.*SHLIB_OPENMP_${f === 'FC' ? '(F|FC)FLAGS' : flags}`));
|
|
164
|
+
if (!hit) {
|
|
165
|
+
const wrong = find(new RegExp(`^[ \\t]*PKG_${flags}.*SHLIB_OPENMP_`));
|
|
166
|
+
if (wrong) {
|
|
167
|
+
note(wrong.line, `incorrect macro SHLIB_OPENMP_${wrong.text.replace(/.*SHLIB_OPENMP_([A-Z]*).*/, '$1')} included in PKG_${flags}`);
|
|
168
|
+
}
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
used.push(flags);
|
|
172
|
+
const defunct = f === 'FC' && all.some(l => l.text.includes('SHLIB_OPENMP_FCFLAGS'));
|
|
173
|
+
const macro = f === 'FC' && !defunct ? 'FFLAGS' : flags;
|
|
174
|
+
const fortran = f === 'F' || f === 'FC';
|
|
175
|
+
if (defunct) {
|
|
176
|
+
note(hit.line, 'SHLIB_OPENMP_FCFLAGS is defunct (used in PKG_FCFLAGS)');
|
|
177
|
+
}
|
|
178
|
+
if (!present) {
|
|
179
|
+
note(hit.line, `SHLIB_OPENMP_${macro} is included in PKG_${flags} without any ${lang} files`);
|
|
180
|
+
}
|
|
181
|
+
else if (!inLibs(fortran ? cOrCxx : flags) && !useFc) {
|
|
182
|
+
note(hit.line, `SHLIB_OPENMP_${macro} is included in PKG_${flags} ` + (libs.some(l => l.text.includes('SHLIB_OPENMP_')) ? fortran ? `but not SHLIB_OPENMP_${cOrCxx} in PKG_LIBS` : 'but not in PKG_LIBS' : 'but no OPENMP macro in PKG_LIBS'));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
let count = 0;
|
|
186
|
+
for (const f of ['C', 'CXX', 'F', 'FC']) {
|
|
187
|
+
const flags = `${f}FLAGS`;
|
|
188
|
+
const at = inLibs(flags)?.line;
|
|
189
|
+
if (at === undefined) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
count++;
|
|
193
|
+
if ((f === 'F' || f === 'FC') && !useFc || f === (have.cxx ? 'C' : 'CXX')) {
|
|
194
|
+
note(at, `SHLIB_OPENMP_${flags} is included in PKG_LIBS but linking is by ${have.cxx ? 'C++' : 'C'}`);
|
|
195
|
+
}
|
|
196
|
+
else if (!used.includes(flags) && !(f === (have.cxx ? 'CXX' : 'C') && (used.includes('FFLAGS') || used.includes('FCFLAGS'))) && !(useFc && f === 'F' && used.join() === 'FCFLAGS')) {
|
|
197
|
+
note(at, `SHLIB_OPENMP_${flags} is included in PKG_LIBS but not in PKG_${flags}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (count > 1) {
|
|
201
|
+
note(libs[0]?.line, 'it is not portable to include multiple SHLIB_OPENMP_* macros in PKG_LIBS');
|
|
202
|
+
}
|
|
203
|
+
const cpp = find(/^[ \t]*PKG_CPPFLAGS.*SHLIB_OPENMP_/);
|
|
204
|
+
if (cpp) {
|
|
205
|
+
note(cpp.line, 'it is not portable to include SHLIB_OPENMP_* macros in PKG_CPPFLAGS; PKG_CPPFLAGS is used for both C and C++ code');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/** the problems of the `SystemRequirements` C++ standard */
|
|
210
|
+
function cxxRequirements(sysReq, config) {
|
|
211
|
+
const items = sysReq.split(',');
|
|
212
|
+
const found = [...config.knownCxxStandards, ...config.obsoleteCxxStandards].find(s => items.some(it => new RegExp(`(^| )C[+][+]${s}([ ,;]|$)`).test(it)));
|
|
213
|
+
return found !== undefined ? config.obsoleteCxxStandards.includes(found) ? [`SystemRequirements specified C++${found}: support has been removed`] : []
|
|
214
|
+
: items.flatMap(it => /^\s*C[+][+]([^,;]*)/.exec(it)?.slice(1).map(s => `SystemRequirements: invalid C++ specification 'C++${s.replace(/ *$/, '')}'`) ?? []);
|
|
215
|
+
}
|
|
216
|
+
/** The line-based checks as data, for the files of a package. */
|
|
217
|
+
function rulesFor(files, config, sysReq, linkingTo, anyFile, have, isBad) {
|
|
218
|
+
const seen = new Set();
|
|
219
|
+
const fresh = (key, message) => seen.has(key) ? undefined : (seen.add(key), message);
|
|
220
|
+
const known = new Set(files.entries.filter(e => !e.isDirectory).map(e => e.relative));
|
|
221
|
+
const verdict = (std) => config.obsoleteCxxStandards.includes(std) ? 'Obsolete' : config.knownCxxStandards.includes(std) ? undefined : 'Unknown';
|
|
222
|
+
const callRe = new RegExp(`(?<![\\w.]|->)(${alt(config.unportableCalls)})\\s*\\(`, 'g');
|
|
223
|
+
const objectRule = (names, symbol, gate) => {
|
|
224
|
+
const re = new RegExp(`(?<![\\w.:]|->)(${alt(names)})\\b`, 'g');
|
|
225
|
+
return { ...Code, gate, line: codeLine(l => [...l.matchAll(re)].map(m => [symbol(m[1])])), message: (file, _, [s]) => report(file, s, s.startsWith('std::') ? 'C++' : 'C') };
|
|
226
|
+
};
|
|
227
|
+
const report = (file, symbol, lang) => fresh(`${file}:${symbol}`, `Found '${symbol}', possibly from '${symbol}' (${lang}): compiled code should not call entry points which ${category(symbol)}`);
|
|
228
|
+
const codeLine = (f) => (l) => /^\s*#\s*(?:include|pragma)\b/.test(l) ? false : f(l);
|
|
229
|
+
const nonApi = new Map([...NonApiEntryPoints, ...config.extraNonApiEntryPoints].map(n => [n.replace(/^Rf_/, ''), n]));
|
|
230
|
+
const nonApiRe = new RegExp(`(?<![\\w.]|->)(?:Rf_)?(${alt([...nonApi.keys()])})\\b`, 'g');
|
|
231
|
+
const Code = { kind: 'compiled code', files: CFamily, prep: (t) => stripC(t, true), uncertain: true };
|
|
232
|
+
const Make = (kind, files) => ({ kind, files, once: true });
|
|
233
|
+
const blas = (lib, after) => {
|
|
234
|
+
const use = new RegExp(`\\$[{(]?${lib}`), followed = new RegExp(`\\$[{(]?${lib}.*\\$[{(]?${after}`);
|
|
235
|
+
return { kind: 'for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS)', files: /^src\/(?:Makevars(?:\.in)?|Makefile(?:\.win|\.ucrt)?)$/, logical: true, when: !anyFile(FortranSrc),
|
|
236
|
+
line: l => /^[ \t]*PKG_LIBS/.test(l) && use.test(l) && !followed.test(l), message: file => `Apparently using $(${lib}) without following $(${after}) in '${file}'` };
|
|
237
|
+
};
|
|
238
|
+
const pragma = (pattern, message, gate) => ({ kind: 'pragmas in C/C++ headers and code', files: /^(?:src|inst\/include)\/.*\.(?:c|cc|cpp|h|hh|hpp)$/, once: true, line: pattern, message, gate });
|
|
239
|
+
const important = /^\s*#pragma (?:GCC|clang) diagnostic ignored[^-]*[-]W(?:uninitialized|float-equal|array-bound|format)/;
|
|
240
|
+
const kindFile = { kind: 'usage of KIND in Fortran files', files: FortranSrc };
|
|
241
|
+
const needs = { C: have.c, CXX: have.cxx, F: have.f || have.f9x, FC: have.f9x, CPP: have.c || have.cxx };
|
|
242
|
+
return [
|
|
243
|
+
{ ...Make('compilation flags in Makevars', MakevarsFile), when: anyFile(/^src\/Makevars\.in$/) && anyFile(/^src\/Makevars$/), files: /^src\/Makevars$/, line: /^/,
|
|
244
|
+
message: 'Package has both \'src/Makevars.in\' and \'src/Makevars\'. Installation with --no-configure\' is unlikely to work. If you intended \'src/Makevars\' to be used on Windows, rename it to \'src/Makevars.win\' otherwise remove it. If \'configure\' created \'src/Makevars\', you need a \'cleanup\' script.' },
|
|
245
|
+
{ kind: 'compilation flags in Makevars', files: MakevarsFile, line: l => {
|
|
246
|
+
const m = new RegExp(`.*[.o]: +PKG_(${Prefixes})FLAGS *=`).exec(l);
|
|
247
|
+
const flags = m ? l.slice(m[0].length).split(/\s+/).filter(isBad) : [];
|
|
248
|
+
return flags.length > 0 && [flags];
|
|
249
|
+
}, message: (file, _, flags) => `Non-portable flags in file '${file}': ${flags.join(' ')}` },
|
|
250
|
+
{ ...Make('for GNU extensions in Makefiles', MakeFile), when: !/GNU [Mm]ake/.test(sysReq.replace(/\s+/g, ' ')), line: l => !/^ *#/.test(l) && !/[$][(].+:=.+[)]/.test(l) && GnuExtension.test(l),
|
|
251
|
+
message: 'Found a file containing GNU extensions. Portable Makefiles do not use GNU extensions such as +=, :=, $(shell), $(wildcard), ifeq ... endif, .NOTPARALLEL' },
|
|
252
|
+
blas('LAPACK_LIBS', 'BLAS_LIBS'), blas('BLAS_LIBS', 'FLIBS'),
|
|
253
|
+
...Object.entries(needs).map(([f, present]) => ({ ...Make('use of PKG_*FLAGS in Makefiles', FlagFile), when: !present, line: new RegExp(`^[ \\t]*PKG_${f}FLAGS`),
|
|
254
|
+
message: file => `PKG_${f}FLAGS set in '${file}' without any corresponding files` })),
|
|
255
|
+
{ ...Make('include directives in Makefiles', /(?:^|\/)(?:Makefile(?:\.in|\.win|\.ucrt)?|makefile|GNUmakefile)$/), line: /^include .*R_HOME/,
|
|
256
|
+
message: 'Found a Makefile with an include directive with a pathname using R_HOME. R_HOME may contain spaces, which Makefile directives cannot portably quote; use the make \'-f\' option to include files in directories specified using R_HOME instead' },
|
|
257
|
+
pragma(important, 'File which contains pragma(s) suppressing important diagnostics'),
|
|
258
|
+
pragma(new RegExp(`^\\s*#pragma (?:GCC|clang) diagnostic[^-]*[-]W(?:${NonPortableWarnings.join('|')})`), 'File which contains non-portable pragma(s)', t => /^\s*#pragma (GCC|clang) diagnostic ignored/m.test(t)),
|
|
259
|
+
pragma(/^\s*#pragma (?:GCC|clang) diagnostic ignored/, 'File which contains pragma(s) suppressing diagnostics', t => !new RegExp(important.source, 'm').test(t)),
|
|
260
|
+
{ ...kindFile, line: l => !FortranComment.test(l) && KindDeclaration.test(l), message: (_, l) => `Found file with non-portable usage of KIND: ${l.trim()}` },
|
|
261
|
+
{ ...kindFile, when: config.flagStarKinds, line: l => !FortranComment.test(l) && !KindDeclaration.test(l) && /\b(?:real|integer|complex|logical)\s*\*\s*\d+/i.test(l.replace(/!.*/, '')),
|
|
262
|
+
message: (_, l) => `Found file with non-portable type declaration (use KIND parameters instead of a byte count): ${l.trim()}` },
|
|
263
|
+
{ kind: 'C++ specification', files: /^src\/Makevars(?:\.in|\.win|\.ucrt)?$/, logical: true, line: /^\s*CXX_STD\s*(?:\+|:)?=\s*CXX(\d+)\s*$/, message: (file, _, [, std]) => verdict(std) && `${verdict(std)} C++${std} standard request will be ignored (CXX_STD in ${file})` },
|
|
264
|
+
{ ...Code, line: codeLine(l => [...l.matchAll(callRe)].filter(m => {
|
|
265
|
+
const pre = l.slice(0, m.index), word = /(\w+)\s*\**\s*$/.exec(pre)?.[1];
|
|
266
|
+
return !(/\w::$/.test(pre) && !/\bstd::$/.test(pre) || word !== undefined && !Declarators.has(word));
|
|
267
|
+
}).map(m => [m[1]])), message: (file, _, [s]) => report(file, s, /\.(c|h)$/.test(file) ? 'C' : 'C++') },
|
|
268
|
+
objectRule(config.unportableObjects, n => n),
|
|
269
|
+
objectRule(config.unportableObjects.filter(o => o.startsWith('std::')).map(o => o.slice(5)), n => `std::${n}`, t => /using\s+namespace\s+std\b/.test(t)),
|
|
270
|
+
{ ...Code, when: config.checkNonApi, gate: t => UsesR.test(t), line: l => /^\s*#\s*(?:include|pragma|define)\b/.test(l) ? false : [...l.matchAll(nonApiRe)].map(m => [nonApi.get(m[1]) ?? m[1]]),
|
|
271
|
+
message: (file, _, [n]) => fresh(`${file}:nonapi:${n}`, `Found non-API call to R: '${n}'. Compiled code should not call non-API entry points in R. This entry point may be removed soon`) },
|
|
272
|
+
{ kind: 'compiled code', files: FortranSrc, uncertain: true, line: (raw, file) => /\.f(?:90|95)$/.test(file) || !/^[cC*!]/.test(raw)
|
|
273
|
+
? FortranStatements.filter(([n, p]) => config.unportableFortran.includes(n) && p.test(raw.replace(/!.*/, ''))).map(([n]) => [n]) : false,
|
|
274
|
+
message: (file, _, [s]) => report(file, s, 'Fortran') },
|
|
275
|
+
{ kind: 'whether package can be installed', files: /^(?:src|inst\/include)\/.*\.(?:c|cc|cpp|cxx|C|h|hh|hpp|hxx)$/, prep: t => stripC(t, false), line: Include, message: (file, _, [, inc]) => {
|
|
276
|
+
const dir = file.slice(0, file.lastIndexOf('/'));
|
|
277
|
+
const pkg = [`${dir}/${inc}`, `src/${inc}`, `inst/include/${inc}`].some(k => known.has(k)) ? undefined
|
|
278
|
+
: Object.entries(config.headerPackages).find(([h]) => h.endsWith('/') ? inc.startsWith(h) : inc === h)?.[1];
|
|
279
|
+
return pkg === undefined || linkingTo.includes(pkg) ? undefined : fresh(`${file}:${pkg}`, `The code includes '${inc}' but the DESCRIPTION does not list '${pkg}' in LinkingTo, so the header is not found when installing`);
|
|
280
|
+
} }
|
|
281
|
+
];
|
|
282
|
+
}
|
|
283
|
+
/** Port of the static `R CMD check` checks on compiled code and build files (Rust compilation and the binary part of the compiled code check are not ported). */
|
|
284
|
+
exports.COMPILED_CODE = {
|
|
285
|
+
createSearch: () => flowr_search_builder_1.Q.from([]),
|
|
286
|
+
processSearchResult: (_elements, config, data) => {
|
|
287
|
+
const ctx = data.inspectContext();
|
|
288
|
+
const pkg = (0, cmd_check_util_1.packageInfo)(ctx);
|
|
289
|
+
const files = (0, package_files_1.packageFiles)(ctx, pkg.name);
|
|
290
|
+
if (files === undefined) {
|
|
291
|
+
return { results: [], '.meta': { consideredFiles: 0 } };
|
|
292
|
+
}
|
|
293
|
+
const found = (0, file_checks_1.fileFindings)(files, config.skip);
|
|
294
|
+
const add = (kind, file, line, message, uncertain) => found.add(kind, file, message, line, uncertain ? linter_format_1.LintingResultCertainty.Uncertain : undefined);
|
|
295
|
+
const sysReq = pkg.description?.content().get('SystemRequirements')?.join(' ') ?? '';
|
|
296
|
+
const anyFile = (p) => files.entries.some(e => !e.isDirectory && p.test(e.relative));
|
|
297
|
+
const have = { c: anyFile(/^src\/.*\.c$/), cxx: anyFile(/^src\/.*\.(cc|cpp)$/), f: anyFile(/^src\/.*\.f$/), f9x: anyFile(/^src\/.*\.f9[05]$/) };
|
|
298
|
+
const bad = new RegExp(`^-(${config.nonPortableFlags.join('|')})$`);
|
|
299
|
+
const isBad = (flag) => bad.test(flag) && !config.allowedFlags.includes(flag);
|
|
300
|
+
checkLineEndings(files, add);
|
|
301
|
+
checkMakevars(files, isBad, add);
|
|
302
|
+
checkOpenMp(files, have, add);
|
|
303
|
+
scan(files, rulesFor(files, config, sysReq, pkg.declared.get('LinkingTo') ?? [], anyFile, have, isBad), add);
|
|
304
|
+
const at = (0, file_checks_1.firstLine)(files, 'DESCRIPTION', /^SystemRequirements:/) ?? 1;
|
|
305
|
+
cxxRequirements(sysReq, config).forEach(m => add('C++ specification', 'DESCRIPTION', at, m));
|
|
306
|
+
const sources = files.entries.filter(e => !e.isDirectory && CSource.test(e.relative));
|
|
307
|
+
const rText = sources.map(e => stripC(files.read(e.relative) ?? '', true)).filter(t => UsesR.test(t));
|
|
308
|
+
(config.checkRegistration && rText.length > 0 ? ['R_registerRoutines', 'R_useDynamicSymbols'] : []).filter(symbol => !rText.some(t => new RegExp(`\\b${symbol}\\b`).test(t)))
|
|
309
|
+
.forEach(symbol => add('compiled code', sources[0].relative, 1, `Found no call to: '${symbol}'. It is good practice to register native routines and to disable symbol search`, true));
|
|
310
|
+
const namespace = ctx.files.getFilesByRole(flowr_file_1.FileRole.Namespace)[0]?.content();
|
|
311
|
+
const compiled = files.entries.find(e => !e.isDirectory && /^src\/.*\.(c|cc|cpp|cxx|C|f|f90|f95|m|mm)$/.test(e.relative));
|
|
312
|
+
const dynLib = Object.entries(namespace ?? {}).some(([name, info]) => name !== 'current' && info.loadsWithSideEffects);
|
|
313
|
+
const installProblem = namespace === undefined ? undefined
|
|
314
|
+
: compiled && !dynLib ? `The package has compiled code ('${compiled.relative}') but its NAMESPACE has no useDynLib directive, so the shared object is never loaded`
|
|
315
|
+
: dynLib && !compiled && files.onDisk && !files.entries.some(e => e.isDirectory && e.relative === 'src') ? 'The NAMESPACE has a useDynLib directive but the package has no src directory, so loading the package fails' : undefined;
|
|
316
|
+
if (installProblem) {
|
|
317
|
+
add('whether package can be installed', 'NAMESPACE', 1, installProblem);
|
|
318
|
+
}
|
|
319
|
+
return { results: found.results, '.meta': { consideredFiles: files.entries.filter(e => !e.isDirectory).length } };
|
|
320
|
+
},
|
|
321
|
+
prettyPrint: {
|
|
322
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: result => `${result.message} at ${range_1.SourceLocation.format(result.loc)}`,
|
|
323
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: result => `checking ${result.kind}: ${result.message} (at ${range_1.SourceLocation.format(result.loc)})`
|
|
324
|
+
},
|
|
325
|
+
info: {
|
|
326
|
+
name: 'Compiled Code',
|
|
327
|
+
tags: [linter_tags_1.LintingRuleTag.CmdCheck],
|
|
328
|
+
certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
329
|
+
description: 'Checks `src/` and the build files: non-portable Makevars flags, BLAS/LAPACK and OpenMP flag use, GNU make extensions, pragmas, line endings, Fortran KIND, the C++ standard, calls to non-API or non-portable entry points, and `useDynLib` against `src/`.',
|
|
330
|
+
defaultConfig: () => ({
|
|
331
|
+
skip: [],
|
|
332
|
+
nonPortableFlags: ['O.*', 'W', 'w', 'W[^l].*', 'ansi', 'pedantic', 'traditional', 'f.*', 'm.*', 'std.*', 'isystem', 'x', 'pipe', 'cpp', 'g', 'q'],
|
|
333
|
+
allowedFlags: [],
|
|
334
|
+
knownCxxStandards: ['26', '23', '20', '17', '14', '11', '98'],
|
|
335
|
+
obsoleteCxxStandards: ['98', '11', '14'],
|
|
336
|
+
unportableCalls: ['abort', 'exit', '_exit', '_Exit', 'printf', 'puts', 'putchar', 'sprintf', 'vprintf', 'vsprintf', 'rand', 'random', 'rand_r', 'srand', 'srandom', 'srandom_r', 'srand48'],
|
|
337
|
+
unportableObjects: ['stderr', 'stdout', 'std::cout', 'std::cerr'],
|
|
338
|
+
unportableFortran: ['print', 'write', 'read', 'open', 'close', 'rewind', 'stop', 'exit', 'rand', 'random_number', 'random_seed', 'random_init'],
|
|
339
|
+
checkNonApi: true,
|
|
340
|
+
extraNonApiEntryPoints: [],
|
|
341
|
+
checkRegistration: true,
|
|
342
|
+
headerPackages: {
|
|
343
|
+
'Rcpp.h': 'Rcpp', 'Rcpp/': 'Rcpp', 'RcppArmadillo.h': 'RcppArmadillo', 'armadillo': 'RcppArmadillo', 'RcppEigen.h': 'RcppEigen',
|
|
344
|
+
'Eigen/': 'RcppEigen', 'cpp11.hpp': 'cpp11', 'cpp11/': 'cpp11', 'boost/': 'BH', 'RcppParallel.h': 'RcppParallel', 'RcppThread.hpp': 'RcppThread'
|
|
345
|
+
},
|
|
346
|
+
flagStarKinds: true
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
//# sourceMappingURL=compiled-code.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LintingRuleNames } from '../../linter-rules';
|
|
2
|
+
/** How much of an `R CMD check` step the linter covers. */
|
|
3
|
+
export declare enum ConformanceLevel {
|
|
4
|
+
/** everything the step reports, statically */
|
|
5
|
+
Full = "full",
|
|
6
|
+
/** what can be decided without building, installing, or running the package */
|
|
7
|
+
Static = "static",
|
|
8
|
+
/** some of what the step reports */
|
|
9
|
+
Partial = "partial"
|
|
10
|
+
}
|
|
11
|
+
/** The sections of the `R CMD check` appendix of the R Packages book (https://r-pkgs.org/R-CMD-check.html), by anchor. */
|
|
12
|
+
export type RPackagesSection = 'check-metadata' | 'package-structure' | 'description' | 'namespace' | 'r-code' | 'data' | 'documentation' | 'demos' | 'compiled-code' | 'tests' | 'vignettes';
|
|
13
|
+
/** One step of `R CMD check` (a `checking ...` line of its log) and the linting rules covering it. */
|
|
14
|
+
export interface ConformanceEntry {
|
|
15
|
+
/** the step, as `R CMD check` names it in its log (`checking <step> ...`) */
|
|
16
|
+
readonly check: string;
|
|
17
|
+
/** the line of {@link CmdCheckSource} that starts the step */
|
|
18
|
+
readonly line: number;
|
|
19
|
+
/** the section of the R Packages book describing the step */
|
|
20
|
+
readonly book: RPackagesSection;
|
|
21
|
+
readonly rules: readonly LintingRuleNames[];
|
|
22
|
+
readonly level: ConformanceLevel;
|
|
23
|
+
/** what is left out, or what flowR adds */
|
|
24
|
+
readonly note?: string;
|
|
25
|
+
}
|
|
26
|
+
/** A group of related `R CMD check` steps. */
|
|
27
|
+
export interface ConformanceArea {
|
|
28
|
+
readonly area: string;
|
|
29
|
+
readonly entries: readonly ConformanceEntry[];
|
|
30
|
+
}
|
|
31
|
+
/** the implementation of `R CMD check` the table follows */
|
|
32
|
+
export declare const CmdCheckSource = "https://github.com/wch/r-source/blob/tags/R-4-6-1/src/library/tools/R/check.R";
|
|
33
|
+
/** the description of `R CMD check` in the R Packages book */
|
|
34
|
+
export declare const RPackagesCmdCheck = "https://r-pkgs.org/R-CMD-check.html";
|
|
35
|
+
/** the description of `R CMD check` in Writing R Extensions */
|
|
36
|
+
export declare const WritingRExtensionsCmdCheck = "https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Checking-packages";
|
|
37
|
+
/**
|
|
38
|
+
* Which linting rules port which step of `R CMD check` (R 4.6.1, `tools:::.check_packages`), so the linter page can
|
|
39
|
+
* show how far flowR conforms to it. A step that needs the package built, installed, or run is covered by the
|
|
40
|
+
* static part of what it checks.
|
|
41
|
+
*/
|
|
42
|
+
export declare const CmdCheckConformance: readonly ConformanceArea[];
|
|
43
|
+
/** The steps of {@link CmdCheckConformance} numbered in the order the table lists them, which is how the wiki refers to them. */
|
|
44
|
+
export declare function numberedConformance(): readonly (ConformanceEntry & {
|
|
45
|
+
readonly number: number;
|
|
46
|
+
readonly area: string;
|
|
47
|
+
})[];
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CmdCheckConformance = exports.WritingRExtensionsCmdCheck = exports.RPackagesCmdCheck = exports.CmdCheckSource = exports.ConformanceLevel = void 0;
|
|
4
|
+
exports.numberedConformance = numberedConformance;
|
|
5
|
+
/** How much of an `R CMD check` step the linter covers. */
|
|
6
|
+
var ConformanceLevel;
|
|
7
|
+
(function (ConformanceLevel) {
|
|
8
|
+
/** everything the step reports, statically */
|
|
9
|
+
ConformanceLevel["Full"] = "full";
|
|
10
|
+
/** what can be decided without building, installing, or running the package */
|
|
11
|
+
ConformanceLevel["Static"] = "static";
|
|
12
|
+
/** some of what the step reports */
|
|
13
|
+
ConformanceLevel["Partial"] = "partial";
|
|
14
|
+
})(ConformanceLevel || (exports.ConformanceLevel = ConformanceLevel = {}));
|
|
15
|
+
const { Full, Static, Partial } = ConformanceLevel;
|
|
16
|
+
/** the implementation of `R CMD check` the table follows */
|
|
17
|
+
exports.CmdCheckSource = 'https://github.com/wch/r-source/blob/tags/R-4-6-1/src/library/tools/R/check.R';
|
|
18
|
+
/** the description of `R CMD check` in the R Packages book */
|
|
19
|
+
exports.RPackagesCmdCheck = 'https://r-pkgs.org/R-CMD-check.html';
|
|
20
|
+
/** the description of `R CMD check` in Writing R Extensions */
|
|
21
|
+
exports.WritingRExtensionsCmdCheck = 'https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Checking-packages';
|
|
22
|
+
/**
|
|
23
|
+
* Which linting rules port which step of `R CMD check` (R 4.6.1, `tools:::.check_packages`), so the linter page can
|
|
24
|
+
* show how far flowR conforms to it. A step that needs the package built, installed, or run is covered by the
|
|
25
|
+
* static part of what it checks.
|
|
26
|
+
*/
|
|
27
|
+
exports.CmdCheckConformance = [
|
|
28
|
+
{
|
|
29
|
+
area: 'The package as a whole',
|
|
30
|
+
entries: [
|
|
31
|
+
{ check: "for file 'DESCRIPTION'", line: 6706, book: 'description', rules: ['description-metadata'], level: Full, note: 'without a DESCRIPTION, flowR does not see a package' },
|
|
32
|
+
{ check: 'whether tarball can be unpacked', line: 7820, book: 'package-structure', rules: ['package-structure'], level: Static, note: 'a source folder needs no unpacking, the path rules of tarballs are checked' },
|
|
33
|
+
{ check: 'package directory', line: 508, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
34
|
+
{ check: 'if this is a source package', line: 7005, book: 'package-structure', rules: ['package-runtime'], level: Full },
|
|
35
|
+
{ check: 'extension type', line: 6755, book: 'description', rules: ['package-runtime'], level: Full },
|
|
36
|
+
{ check: 'package bundle', line: 6765, book: 'description', rules: ['description-metadata'], level: Partial, note: 'bundles are defunct since R 2.11' },
|
|
37
|
+
{ check: 'if there is a namespace', line: 7971, book: 'namespace', rules: ['package-runtime'], level: Full, note: 'needs the package on disk' }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
area: 'Package structure and files',
|
|
42
|
+
entries: [
|
|
43
|
+
{ check: 'for portable file names', line: 776, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
44
|
+
{ check: 'for sufficient/correct file permissions', line: 928, book: 'package-structure', rules: ['package-structure'], level: Full, note: 'needs the package on disk' },
|
|
45
|
+
{ check: 'for executable files', line: 5798, book: 'package-structure', rules: ['package-structure'], level: Full, note: 'needs the package on disk' },
|
|
46
|
+
{ check: 'for hidden files and directories', line: 5874, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
47
|
+
{ check: 'for .dll and .exe files', line: 5840, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
48
|
+
{ check: 'for future file timestamps', line: 525, book: 'package-structure', rules: ['package-structure'], level: Full, note: 'needs the package on disk' },
|
|
49
|
+
{ check: 'top-level files', line: 1371, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
50
|
+
{ check: 'for left-over files', line: 1733, book: 'r-code', rules: ['package-structure'], level: Full },
|
|
51
|
+
{ check: 'package subdirectories', line: 1796, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
52
|
+
{ check: "'build' directory", line: 1325, book: 'package-structure', rules: ['package-structure'], level: Full },
|
|
53
|
+
{ check: 'installed package size', line: 6672, book: 'r-code', rules: ['package-structure'], level: Static, note: 'estimated from the files that would be installed' },
|
|
54
|
+
{ check: "sizes of PDF files under 'inst/doc'", line: 3356, book: 'vignettes', rules: ['package-structure'], level: Static, note: 'reports large PDFs, cannot compact them' },
|
|
55
|
+
{ check: 'line endings in shell scripts', line: 3414, book: 'package-structure', rules: ['package-structure', 'compiled-code'], level: Full },
|
|
56
|
+
{ check: "files in 'vignettes'", line: 3204, book: 'vignettes', rules: ['package-structure'], level: Full },
|
|
57
|
+
{ check: 'for left-overs from vignette generation', line: 696, book: 'vignettes', rules: ['package-structure'], level: Full },
|
|
58
|
+
{ check: "installed files from 'inst/doc'", line: 3106, book: 'vignettes', rules: ['package-structure'], level: Static },
|
|
59
|
+
{ check: 'for code which exercises the package', line: 8103, book: 'tests', rules: ['software-has-tests'], level: Full }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
area: 'DESCRIPTION and dependencies',
|
|
64
|
+
entries: [
|
|
65
|
+
{ check: 'DESCRIPTION meta-information', line: 1008, book: 'description', rules: ['description-metadata', 'software-has-license'], level: Full },
|
|
66
|
+
{ check: 'CRAN incoming feasibility', line: 6786, book: 'description', rules: ['description-metadata'], level: Partial, note: 'the DESCRIPTION based notes; repository queries are left out' },
|
|
67
|
+
{ check: 'package dependencies', line: 6949, book: 'description', rules: ['dependency-declaration', 'description-metadata'], level: Static, note: 'availability and versions asked of the signature database instead of the repositories' },
|
|
68
|
+
{ check: 'dependencies in R code', line: 2169, book: 'description', rules: ['dependency-declaration', 'namespace-access'], level: Full, note: 'resolves package names through variables, knows the loaders of other packages' },
|
|
69
|
+
{ check: 'for unstated dependencies in tests', line: 4779, book: 'tests', rules: ['dependency-declaration'], level: Full },
|
|
70
|
+
{ check: 'for unstated dependencies in examples', line: 2865, book: 'documentation', rules: ['dependency-declaration'], level: Full },
|
|
71
|
+
{ check: 'for unstated dependencies in vignettes', line: 4954, book: 'vignettes', rules: ['dependency-declaration'], level: Full, note: 'including \\VignetteDepends, \\VignetteEngine, VignetteBuilder' },
|
|
72
|
+
{ check: 'whether the package can be loaded with stated dependencies', line: 4173, book: 'description', rules: ['dependency-declaration'], level: Static },
|
|
73
|
+
{ check: 'whether the namespace can be loaded with stated dependencies', line: 4210, book: 'description', rules: ['dependency-declaration', 'package-runtime'], level: Static },
|
|
74
|
+
{ check: 'LazyData', line: 3037, book: 'data', rules: ['package-data'], level: Full }
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
area: 'R code',
|
|
79
|
+
entries: [
|
|
80
|
+
{ check: 'R files for syntax errors', line: 2154, book: 'r-code', rules: ['syntactically-valid'], level: Full },
|
|
81
|
+
{ check: 'code files for non-ASCII characters', line: 2133, book: 'r-code', rules: ['non-ascii-code'], level: Full, note: 'reports each token, escapes strings as a quick fix' },
|
|
82
|
+
{ check: 'R code for possible problems', line: 2302, book: 'r-code', rules: ['undefined-symbol', 'call-arguments', 'global-environment-modification', 'class-string-comparison', 'bogus-return', 'package-hooks', 'namespace-tampering', 'deprecated-functions', 'true-false-abbreviation'], level: Full, note: 'codetools usage checks and the tools:::.check_package_code_* notes; resolves calls through the dataflow graph' },
|
|
83
|
+
{ check: 'S3 generic/method consistency', line: 2198, book: 'r-code', rules: ['s3-method-consistency'], level: Full },
|
|
84
|
+
{ check: 'replacement functions', line: 2235, book: 'r-code', rules: ['s3-method-consistency'], level: Full },
|
|
85
|
+
{ check: 'foreign function calls', line: 2262, book: 'r-code', rules: ['foreign-function-calls'], level: Static, note: 'the routine registration needs the installed package' },
|
|
86
|
+
{ check: 'use of S3 registration', line: 4333, book: 'r-code', rules: ['s3-method-consistency'], level: Static },
|
|
87
|
+
{ check: 'whether startup messages can be suppressed', line: 4306, book: 'r-code', rules: ['package-hooks'], level: Static, note: 'output in package hooks not sent through packageStartupMessage' },
|
|
88
|
+
{ check: 'whether the namespace can be unloaded cleanly', line: 4258, book: 'r-code', rules: ['package-hooks'], level: Static },
|
|
89
|
+
{ check: 'package namespace information', line: 6863, book: 'namespace', rules: ['documentation-mismatch', 'non-ascii-code', 'package-hooks'], level: Partial }
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
area: 'Documentation',
|
|
94
|
+
entries: [
|
|
95
|
+
{ check: 'Rd files', line: 2514, book: 'documentation', rules: ['rd-files'], level: Full },
|
|
96
|
+
{ check: 'Rd metadata', line: 2570, book: 'documentation', rules: ['rd-files'], level: Full },
|
|
97
|
+
{ check: 'Rd cross-references', line: 2615, book: 'documentation', rules: ['rd-files'], level: Static, note: 'targets in other packages are asked of the signature database' },
|
|
98
|
+
{ check: 'for missing documentation entries', line: 2694, book: 'documentation', rules: ['documentation-mismatch', 'package-data'], level: Full },
|
|
99
|
+
{ check: 'for code/documentation mismatches', line: 2737, book: 'documentation', rules: ['documentation-mismatch'], level: Full },
|
|
100
|
+
{ check: 'Rd \\usage sections', line: 2788, book: 'documentation', rules: ['documentation-mismatch', 'rd-files'], level: Full },
|
|
101
|
+
{ check: 'Rd contents', line: 2849, book: 'documentation', rules: ['rd-files'], level: Full },
|
|
102
|
+
{ check: 'Rd line widths', line: 2594, book: 'documentation', rules: ['rd-files'], level: Full },
|
|
103
|
+
{ check: 'examples', line: 4656, book: 'documentation', rules: ['rd-files', 'dependency-declaration'], level: Static, note: 'parses the examples and checks what they call, without running them' },
|
|
104
|
+
{ check: 'PDF version of manual', line: 5540, book: 'documentation', rules: ['rd-files'], level: Static, note: 'the Rd constructs that break the LaTeX rendering' },
|
|
105
|
+
{ check: 'PDF version of manual without index', line: 5579, book: 'documentation', rules: ['rd-files'], level: Static },
|
|
106
|
+
{ check: 'index information', line: 1752, book: 'documentation', rules: ['package-metafiles'], level: Full },
|
|
107
|
+
{ check: 'demos', line: 4793, book: 'demos', rules: ['package-metafiles', 'package-structure'], level: Static, note: 'the demo index and file names, the demos are not run' },
|
|
108
|
+
{ check: 'package subdirectories (CITATION)', line: 1796, book: 'documentation', rules: ['package-metafiles'], level: Full },
|
|
109
|
+
{ check: 'relative paths in package URLs', line: 4402, book: 'documentation', rules: ['package-metafiles'], level: Static }
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
area: 'Data',
|
|
114
|
+
entries: [
|
|
115
|
+
{ check: "contents of 'data' directory", line: 2891, book: 'data', rules: ['package-data'], level: Full },
|
|
116
|
+
{ check: 'data for ASCII and uncompressed saves', line: 3077, book: 'data', rules: ['package-data'], level: Full },
|
|
117
|
+
{ check: 'R/sysdata.rda', line: 3090, book: 'data', rules: ['package-data'], level: Full },
|
|
118
|
+
{ check: 'serialization versions', line: 988, book: 'data', rules: ['package-data'], level: Full },
|
|
119
|
+
{ check: 'data for non-ASCII characters', line: 3002, book: 'data', rules: ['package-data'], level: Partial, note: 'the encodings of saved strings are not read' }
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
area: 'Compiled code',
|
|
124
|
+
entries: [
|
|
125
|
+
{ check: 'compilation flags in Makevars', line: 3501, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
126
|
+
{ check: 'use of PKG_*FLAGS in Makefiles', line: 3611, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
127
|
+
{ check: 'use of SHLIB_OPENMP_*FLAGS in Makefiles', line: 3643, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
128
|
+
{ check: 'for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS)', line: 3559, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
129
|
+
{ check: 'for GNU extensions in Makefiles', line: 3514, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
130
|
+
{ check: 'include directives in Makefiles', line: 3848, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
131
|
+
{ check: 'line endings in Makefiles', line: 3479, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
132
|
+
{ check: 'line endings in C/C++/Fortran sources/headers', line: 3436, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
133
|
+
{ check: 'pragmas in C/C++ headers and code', line: 3882, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
134
|
+
{ check: 'usage of KIND in Fortran files', line: 656, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
135
|
+
{ check: 'C++ specification', line: 6642, book: 'compiled-code', rules: ['compiled-code'], level: Full },
|
|
136
|
+
{ check: 'compiled code', line: 4010, book: 'compiled-code', rules: ['compiled-code'], level: Static, note: 'the calls the shared object would import, read off the sources' },
|
|
137
|
+
{ check: 'whether package can be installed', line: 5961, book: 'r-code', rules: ['compiled-code', 'dependency-declaration', 'package-runtime'], level: Static, note: 'useDynLib and src/ in agreement, headers from LinkingTo, undefined exports' },
|
|
138
|
+
{ check: 'compilation flags used', line: 3934, book: 'compiled-code', rules: ['compiled-code'], level: Static, note: 'the flags the Makevars state, not the ones the toolchain was called with' },
|
|
139
|
+
{ check: 'Rust compilation', line: 4120, book: 'compiled-code', rules: ['package-runtime'], level: Static, note: 'Rust sources need Cargo and rustc in SystemRequirements' }
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
area: 'Installing, loading, and running',
|
|
144
|
+
entries: [
|
|
145
|
+
{ check: 'whether the package can be loaded', line: 4144, book: 'r-code', rules: ['package-runtime'], level: Static, note: 'S3 methods registered without a function, imports of unexported names' },
|
|
146
|
+
{ check: 'loading without being on the library search path', line: 4282, book: 'r-code', rules: ['package-runtime'], level: Static, note: 'the package attaching itself' },
|
|
147
|
+
{ check: 'whether the package can be unloaded cleanly', line: 4189, book: 'r-code', rules: ['package-hooks'], level: Static },
|
|
148
|
+
{ check: 'tests', line: 4797, book: 'tests', rules: ['package-runtime', 'dependency-declaration'], level: Static, note: 'tests that never run, run another package, or do not parse' },
|
|
149
|
+
{ check: 'for differences from example reference output', line: 4639, book: 'tests', rules: ['package-runtime'], level: Static, note: 'reference output without its test' },
|
|
150
|
+
{ check: 'running R code from vignettes', line: 5255, book: 'vignettes', rules: ['package-runtime', 'dependency-declaration'], level: Static, note: 'vignette code that does not parse' },
|
|
151
|
+
{ check: 're-building of vignette outputs', line: 5400, book: 'vignettes', rules: ['package-runtime'], level: Static, note: 'vignettes without index entry or engine' },
|
|
152
|
+
{ check: 'package vignettes', line: 4944, book: 'vignettes', rules: ['package-runtime', 'package-structure'], level: Static },
|
|
153
|
+
{ check: 'examples with --run-donttest', line: 4738, book: 'documentation', rules: ['rd-files', 'dependency-declaration'], level: Static, note: 'the \\donttest code is checked like all examples' },
|
|
154
|
+
{ check: 'for non-standard things in the check directory', line: 8110, book: 'package-structure', rules: ['package-runtime', 'rd-files'], level: Static, note: 'files tests, vignettes, and examples write into the working directory' },
|
|
155
|
+
{ check: 'for detritus in the temp directory', line: 8151, book: 'package-structure', rules: ['package-runtime', 'rd-files'], level: Partial, note: 'only the files written by name' },
|
|
156
|
+
{ check: 'for new files in some other directories', line: 8173, book: 'package-structure', rules: ['package-runtime', 'rd-files'], level: Partial, note: 'only the files written by name' },
|
|
157
|
+
{ check: 'HTML version of manual', line: 5641, book: 'documentation', rules: ['rd-files'], level: Static, note: 'the Rd files that would not render' }
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
/** The steps of {@link CmdCheckConformance} numbered in the order the table lists them, which is how the wiki refers to them. */
|
|
162
|
+
function numberedConformance() {
|
|
163
|
+
let number = 0;
|
|
164
|
+
return exports.CmdCheckConformance.flatMap(({ area, entries }) => entries.map(e => ({ ...e, area, number: ++number })));
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=conformance.js.map
|