@eagleoutice/flowr 2.11.0 → 2.12.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.
Files changed (256) hide show
  1. package/README.md +190 -260
  2. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -1
  3. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  4. package/abstract-interpretation/domains/set-upper-bound-domain.js +6 -2
  5. package/benchmark/slicer.d.ts +1 -1
  6. package/benchmark/slicer.js +3 -1
  7. package/benchmark/summarizer/second-phase/graph.js +5 -0
  8. package/cli/common/options.d.ts +8 -0
  9. package/cli/common/options.js +2 -0
  10. package/cli/common/scripts-info.d.ts +8 -0
  11. package/cli/flowr.js +1 -1
  12. package/cli/repl/commands/repl-commands.d.ts +1 -0
  13. package/cli/repl/commands/repl-commands.js +69 -17
  14. package/cli/repl/commands/repl-dataflow.js +48 -4
  15. package/cli/repl/commands/repl-main.d.ts +2 -0
  16. package/cli/repl/commands/repl-main.js +5 -0
  17. package/cli/repl/commands/repl-query.d.ts +4 -1
  18. package/cli/repl/commands/repl-query.js +72 -22
  19. package/cli/repl/commands/repl-signature.d.ts +7 -0
  20. package/cli/repl/commands/repl-signature.js +119 -0
  21. package/cli/repl/core.d.ts +8 -1
  22. package/cli/repl/core.js +46 -6
  23. package/cli/repl/ghost-hint.d.ts +37 -0
  24. package/cli/repl/ghost-hint.js +72 -0
  25. package/cli/repl/parser/slice-query-parser.d.ts +11 -1
  26. package/cli/repl/parser/slice-query-parser.js +45 -16
  27. package/cli/repl/print-version.d.ts +2 -4
  28. package/cli/repl/print-version.js +41 -23
  29. package/cli/repl/server/connection.js +19 -17
  30. package/cli/slicer-app.d.ts +2 -0
  31. package/cli/slicer-app.js +3 -3
  32. package/cli/wiki.d.ts +2 -2
  33. package/cli/wiki.js +2 -2
  34. package/config.d.ts +70 -13
  35. package/config.js +65 -7
  36. package/control-flow/cfg-dead-code.js +0 -1
  37. package/control-flow/control-flow-graph.js +6 -6
  38. package/control-flow/diff-cfg.js +2 -2
  39. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  40. package/core/print/slice-diff-ansi.js +8 -8
  41. package/core/steps/all/core/20-dataflow.d.ts +2 -2
  42. package/core/steps/all/static-slicing/00-slice.d.ts +5 -0
  43. package/core/steps/all/static-slicing/00-slice.js +1 -1
  44. package/core/steps/all/static-slicing/10-reconstruct.d.ts +7 -0
  45. package/core/steps/all/static-slicing/10-reconstruct.js +6 -2
  46. package/core/steps/pipeline/default-pipelines.d.ts +20 -16
  47. package/data/r-base-packages.generated.d.ts +44 -0
  48. package/data/r-base-packages.generated.js +32 -0
  49. package/data/r-base-primitives.generated.d.ts +1 -0
  50. package/data/r-base-primitives.generated.js +15 -0
  51. package/data/sigdb/sigdb.remote.json +112 -0
  52. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  53. package/dataflow/environments/built-in-proc-name.js +4 -0
  54. package/dataflow/environments/built-in.d.ts +14 -4
  55. package/dataflow/environments/built-in.js +13 -2
  56. package/dataflow/environments/data-masking-functions.d.ts +12 -0
  57. package/dataflow/environments/data-masking-functions.js +46 -0
  58. package/dataflow/environments/default-builtin-config.d.ts +72 -19
  59. package/dataflow/environments/default-builtin-config.js +48 -14
  60. package/dataflow/environments/diff.js +1 -1
  61. package/dataflow/environments/environment.js +1 -2
  62. package/dataflow/environments/identifier.d.ts +11 -4
  63. package/dataflow/environments/identifier.js +28 -10
  64. package/dataflow/environments/resolve-by-name.js +16 -2
  65. package/dataflow/extractor.js +6 -3
  66. package/dataflow/graph/call-graph.d.ts +2 -2
  67. package/dataflow/graph/df-helper.d.ts +4 -4
  68. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  69. package/dataflow/graph/edge.d.ts +3 -3
  70. package/dataflow/graph/edge.js +3 -3
  71. package/dataflow/graph/graph-helper.d.ts +2 -2
  72. package/dataflow/internal/linker.js +1 -1
  73. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +7 -0
  74. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +20 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +1 -0
  76. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -49
  77. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -1
  78. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +7 -1
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +19 -0
  80. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +111 -6
  81. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +13 -0
  82. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +9 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +19 -0
  85. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +12 -4
  86. package/dataflow/internal/process/functions/call/common.js +8 -1
  87. package/dataflow/internal/process/functions/call/default-call-handling.js +6 -0
  88. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +17 -0
  89. package/dataflow/internal/process/functions/call/known-call-handling.js +32 -0
  90. package/dataflow/internal/process/functions/call/named-call-handling.js +29 -7
  91. package/dataflow/internal/process/functions/process-argument.js +12 -1
  92. package/dataflow/internal/process/process-named-call.d.ts +18 -1
  93. package/dataflow/internal/process/process-named-call.js +94 -0
  94. package/dataflow/processor.d.ts +18 -0
  95. package/documentation/data/faq/faqs.js +5 -1
  96. package/documentation/doc-capabilities.js +1 -1
  97. package/documentation/doc-util/doc-cli-option.d.ts +10 -0
  98. package/documentation/doc-util/doc-cli-option.js +23 -0
  99. package/documentation/doc-util/doc-dfg.js +2 -1
  100. package/documentation/doc-util/doc-query.d.ts +9 -3
  101. package/documentation/doc-util/doc-query.js +9 -4
  102. package/documentation/wiki-dataflow-graph.js +8 -5
  103. package/documentation/wiki-interface.js +3 -2
  104. package/documentation/wiki-linter.js +1 -1
  105. package/documentation/wiki-linting-and-testing.js +4 -1
  106. package/documentation/wiki-mk/doc-context.d.ts +14 -0
  107. package/documentation/wiki-mk/doc-context.js +3 -0
  108. package/documentation/wiki-mk/doc-maker.js +3 -1
  109. package/documentation/wiki-query.js +19 -1
  110. package/documentation/wiki-setup.js +10 -7
  111. package/documentation/wiki-signature-database.d.ts +16 -0
  112. package/documentation/wiki-signature-database.js +293 -0
  113. package/linter/linter-format.d.ts +7 -0
  114. package/linter/linter-rules.d.ts +10 -9
  115. package/linter/rules/naming-convention.d.ts +1 -0
  116. package/linter/rules/naming-convention.js +2 -0
  117. package/linter/rules/no-leaked-credentials.js +1 -2
  118. package/linter/rules/roxygen-arguments.js +18 -5
  119. package/linter/rules/stop-with-call-arg.js +2 -2
  120. package/linter/rules/undefined-symbol-util.d.ts +36 -0
  121. package/linter/rules/undefined-symbol-util.js +149 -0
  122. package/linter/rules/undefined-symbol.d.ts +58 -17
  123. package/linter/rules/undefined-symbol.js +143 -33
  124. package/linter/rules/unused-definition.d.ts +8 -1
  125. package/linter/rules/unused-definition.js +126 -1
  126. package/package.json +23 -10
  127. package/project/context/abstract-flowr-analyzer-context.js +7 -1
  128. package/project/context/flowr-analyzer-context.d.ts +8 -0
  129. package/project/context/flowr-analyzer-context.js +10 -0
  130. package/project/context/flowr-analyzer-dependencies-context.d.ts +28 -4
  131. package/project/context/flowr-analyzer-dependencies-context.js +53 -1
  132. package/project/context/flowr-analyzer-files-context.d.ts +1 -0
  133. package/project/context/flowr-analyzer-files-context.js +2 -1
  134. package/project/context/flowr-analyzer-functions-context.js +1 -1
  135. package/project/context/flowr-file.d.ts +5 -0
  136. package/project/context/flowr-file.js +5 -0
  137. package/project/flowr-analyzer-builder.js +12 -2
  138. package/project/plugins/file-plugins/files/flowr-description-file.js +6 -3
  139. package/project/plugins/file-plugins/files/flowr-namespace-file.js +9 -3
  140. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -3
  141. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +26 -0
  142. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +39 -0
  143. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  144. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -2
  145. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -0
  146. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +18 -2
  147. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +19 -0
  148. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +120 -0
  149. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +518 -0
  150. package/project/plugins/package-version-plugins/package.d.ts +5 -3
  151. package/project/plugins/package-version-plugins/package.js +27 -25
  152. package/project/plugins/plugin-registry.d.ts +3 -2
  153. package/project/plugins/plugin-registry.js +4 -2
  154. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +7 -2
  155. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +3 -1
  156. package/project/sigdb/build.d.ts +131 -0
  157. package/project/sigdb/build.js +628 -0
  158. package/project/sigdb/codec.d.ts +51 -0
  159. package/project/sigdb/codec.js +122 -0
  160. package/project/sigdb/decode.d.ts +58 -0
  161. package/project/sigdb/decode.js +129 -0
  162. package/project/sigdb/decompress.d.ts +44 -0
  163. package/project/sigdb/decompress.js +176 -0
  164. package/project/sigdb/hash.d.ts +9 -0
  165. package/project/sigdb/hash.js +54 -0
  166. package/project/sigdb/index-format.d.ts +40 -0
  167. package/project/sigdb/index-format.js +28 -0
  168. package/project/sigdb/manifest.d.ts +68 -0
  169. package/project/sigdb/manifest.js +146 -0
  170. package/project/sigdb/reader.d.ts +250 -0
  171. package/project/sigdb/reader.js +692 -0
  172. package/project/sigdb/schema.d.ts +196 -0
  173. package/project/sigdb/schema.js +33 -0
  174. package/project/sigdb/sigdb-download.d.ts +65 -0
  175. package/project/sigdb/sigdb-download.js +237 -0
  176. package/project/sigdb/signature-match.d.ts +26 -0
  177. package/project/sigdb/signature-match.js +40 -0
  178. package/project/sigdb/version.d.ts +20 -0
  179. package/project/sigdb/version.js +55 -0
  180. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -3
  181. package/queries/catalog/config-query/config-query-format.d.ts +3 -1
  182. package/queries/catalog/config-query/config-query-format.js +68 -9
  183. package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -1
  184. package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
  185. package/queries/catalog/linter-query/linter-query-executor.d.ts +2 -0
  186. package/queries/catalog/linter-query/linter-query-executor.js +6 -1
  187. package/queries/catalog/linter-query/linter-query-format.d.ts +2 -1
  188. package/queries/catalog/linter-query/linter-query-format.js +40 -8
  189. package/queries/catalog/project-query/project-query-executor.d.ts +15 -0
  190. package/queries/catalog/project-query/project-query-executor.js +96 -4
  191. package/queries/catalog/project-query/project-query-format.d.ts +44 -0
  192. package/queries/catalog/project-query/project-query-format.js +33 -2
  193. package/queries/catalog/signature-query/signature-query-executor.d.ts +29 -0
  194. package/queries/catalog/signature-query/signature-query-executor.js +461 -0
  195. package/queries/catalog/signature-query/signature-query-format.d.ts +138 -0
  196. package/queries/catalog/signature-query/signature-query-format.js +76 -0
  197. package/queries/catalog/signature-query/signature-query-render.d.ts +15 -0
  198. package/queries/catalog/signature-query/signature-query-render.js +155 -0
  199. package/queries/catalog/static-slice-query/static-slice-query-executor.js +9 -3
  200. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +10 -0
  201. package/queries/catalog/static-slice-query/static-slice-query-format.js +19 -1
  202. package/queries/query-print.js +5 -0
  203. package/queries/query.d.ts +10 -1
  204. package/queries/query.js +5 -2
  205. package/r-bridge/init.js +5 -1
  206. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +10 -0
  207. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +55 -0
  208. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +16 -0
  209. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +27 -0
  210. package/r-bridge/lang-4.x/ast/parser/json/format.js +89 -2
  211. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -4
  212. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +2 -1
  213. package/r-bridge/parser.d.ts +2 -0
  214. package/r-bridge/retriever.js +4 -1
  215. package/r-bridge/roxygen2/documentation-provider.js +2 -1
  216. package/r-bridge/shell.d.ts +5 -0
  217. package/r-bridge/shell.js +17 -1
  218. package/reconstruct/inline/source-inline-map.d.ts +48 -0
  219. package/reconstruct/inline/source-inline-map.js +94 -0
  220. package/reconstruct/reconstruct.d.ts +19 -2
  221. package/reconstruct/reconstruct.js +79 -16
  222. package/search/search-executor/search-generators.js +5 -22
  223. package/search/search-executor/search-transformer.js +10 -6
  224. package/slicing/criterion/parse.d.ts +22 -4
  225. package/slicing/criterion/parse.js +125 -18
  226. package/slicing/static/slice-call.d.ts +24 -1
  227. package/slicing/static/slice-call.js +90 -0
  228. package/slicing/static/static-slicer.d.ts +7 -0
  229. package/slicing/static/static-slicer.js +38 -3
  230. package/util/collections/arrays.d.ts +4 -5
  231. package/util/collections/arrays.js +7 -18
  232. package/util/hash.d.ts +14 -0
  233. package/util/hash.js +31 -0
  234. package/util/mermaid/dfg.d.ts +7 -2
  235. package/util/mermaid/dfg.js +53 -13
  236. package/util/r-base-packages.d.ts +19 -0
  237. package/util/r-base-packages.js +72 -0
  238. package/util/r-license.js +2 -10
  239. package/util/r-version.d.ts +45 -15
  240. package/util/r-version.js +97 -36
  241. package/util/range.d.ts +15 -0
  242. package/util/range.js +39 -0
  243. package/util/schema.d.ts +10 -0
  244. package/util/schema.js +22 -0
  245. package/util/text/ansi.d.ts +13 -1
  246. package/util/text/ansi.js +27 -4
  247. package/util/text/args.js +1 -2
  248. package/util/version.js +28 -8
  249. package/data/pkgdb/pkgdb-latest.json.br +0 -0
  250. package/data/pkgdb/pkgdb-tiny.json.br +0 -0
  251. package/documentation/wiki-package-database.d.ts +0 -9
  252. package/documentation/wiki-package-database.js +0 -63
  253. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +0 -63
  254. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +0 -174
  255. package/project/plugins/package-version-plugins/pkgdb.d.ts +0 -133
  256. package/project/plugins/package-version-plugins/pkgdb.js +0 -370
@@ -26,7 +26,9 @@ const DefaultReplacementPatterns = [
26
26
  [/%2Fhome%2F([a-zA-Z0-9._-]+%2F)*/g, ''],
27
27
  // async wrapper depends on whether the promise got fulfilled already
28
28
  [/async|%20/g, ''],
29
- [/\s*Copied mermaid url to clipboard\s*\([^)]+\)/gmi, '']
29
+ [/\s*Copied mermaid url to clipboard\s*\([^)]+\)/gmi, ''],
30
+ // mute signature database load time variance in wiki table
31
+ [/≈\s*<?[\d.]+\s*[µm]s/g, '']
30
32
  ];
31
33
  /**
32
34
  * Abstract base class for generating wiki files.
@@ -548,6 +548,8 @@ Now, the results no longer contain calls to \`plot\` that are not defined locall
548
548
  buildExplanation: async (shell, ctx) => {
549
549
  const exampleCode = 'x <- 1\ny <- 2\nz <- 3\nx';
550
550
  const criteria = ['3@z', '4@x'];
551
+ const sourceExample = 'source("library.R")\nprint(greeting)';
552
+ const sourceCriteria = ['2@print'];
551
553
  return `
552
554
  To slice, _flowR_ needs one thing from you: a variable or a list of variables (function calls are supported to, referring to the anonymous
553
555
  return of the call) that you want to slice the dataflow graph for (additionally, you have to tell flowR if you want to have a forward slice).
@@ -580,6 +582,22 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
580
582
  direction: slice_direction_1.SliceDirection.Forward
581
583
  }], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@x'], (0, doc_escape_1.escapeNewline)(exampleCode), true), ctx })}
582
584
 
585
+ If your program pulls in other files with \`source(...)\`, the \`inlineSources\` flag splices the reconstruction
586
+ of each resolvable sourced file into the place of its \`source()\` call, so the slice becomes a single
587
+ self-contained R text (cyclic or unresolvable \`source()\` calls are kept verbatim and reported via
588
+ \`reconstruct.inlineWarnings\`). With the ${(0, doc_cli_option_1.getReplCommand)('query')} REPL command you append an \`i\` to the
589
+ criteria (and may combine it with the forward \`f\` as \`fi\`), for example (with a faked \`library.R\` providing \`greeting\`):
590
+ ${await (0, doc_query_1.showQuery)(shell, sourceExample, [{
591
+ type: 'static-slice',
592
+ criteria: sourceCriteria,
593
+ inlineSources: true
594
+ }], {
595
+ showCode: false,
596
+ shorthand: (0, doc_query_1.sliceQueryShorthand)(sourceCriteria, (0, doc_escape_1.escapeNewline)(sourceExample), false, true),
597
+ ctx,
598
+ files: [{ name: 'library.R', content: 'greeting <- "hello"\nunused <- 123' }]
599
+ })}
600
+
583
601
  You can disable ${ctx.linkPage('wiki/Interface', 'magic comments', 'slice-magic-comments')} using the \`noMagicComments\` flag.
584
602
  This query replaces the old ${ctx.linkPage('wiki/Interface', '`request-slice`', 'message-request-slice')} message.
585
603
  `;
@@ -660,7 +678,7 @@ print("hello world!")
660
678
  return `
661
679
  This query extracts all dependencies from an R script, using a combination of a ${(0, doc_query_1.linkToQueryOfName)('call-context')}
662
680
  and more advanced tracking in the ${ctx.linkPage('wiki/Dataflow Graph', 'Dataflow Graph')}.
663
- Loaded libraries are resolved against the ${ctx.linkPage('wiki/Package Database', 'package database')}.
681
+ Loaded libraries are resolved against the ${ctx.linkPage('wiki/Signature Database', 'signature database')}.
664
682
 
665
683
  In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns the loaded library:
666
684
  ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WikiSetup = void 0;
4
4
  const doc_maker_1 = require("./wiki-mk/doc-maker");
5
+ const doc_files_1 = require("./doc-util/doc-files");
5
6
  /**
6
7
  * https://github.com/flowr-analysis/flowr/wiki/Setup
7
8
  */
@@ -23,7 +24,7 @@ or use its ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')} and $
23
24
 
24
25
 
25
26
  If you want to develop for _flowR_, you want to see how to [build from scratch](#-building-from-scratch) and have a
26
- look at the [Contributing Guidelines](https://github.com/flowr-analysis/flowr/tree/main//.github/CONTRIBUTING.md).
27
+ look at the [Contributing Guidelines](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md).
27
28
 
28
29
  ## 🗒️ Using the Visual Studio Code Extension
29
30
 
@@ -65,12 +66,12 @@ For more information, see the ${ctx.linkPage('wiki/Interface')} wiki page.
65
66
  ## ⚒️ Building From Scratch
66
67
 
67
68
  To use _flowR_, you may need [_R_](https://www.r-project.org/) installed and on your path
68
- (this only affects the [\`r-shell\` engine][r-shell], which is _not_ the default).
69
+ (this only affects the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}, which is _not_ the default).
69
70
 
70
71
  ### Installing R
71
72
  Although there are several ways to do so, there is nothing wrong with installing&nbsp;R with the help of your favorite package manager or directly from the [website](https://cloud.r-project.org/).<a href="#note1" id="note1ref"><sup>&lt;1&gt;</sup></a>
72
73
  For 🪟&nbsp;Windows, see [here](https://www.hanss.info/sebastian/post/rtools-path/) for an explanation on how to add [_R_](https://www.r-project.org/) to your path variable.
73
- Again, you only require this for the [\`r-shell\` engine][r-shell].
74
+ Again, you only require this for the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}.
74
75
 
75
76
  ### Installing Node.js
76
77
 
@@ -105,15 +106,17 @@ At the time of writing this, there is currently no page for frequently encounter
105
106
  ## 📜 Developing for _flowR_
106
107
 
107
108
  If you want to develop for _flowR_, explore the wiki.
108
- For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository.
109
+ For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md) in the repository.
110
+
111
+ ### 📦 The Signature Database
112
+
113
+ _flowR_ resolves \`library(pkg)\`/\`pkg::fn\` calls from a downloaded signature database (\`flowr-sigdb\`); no shards are committed (only the \`sigdb.remote.json\` pointer), everything else is fetched on demand &mdash; see the ${ctx.linkPage('wiki/Signature Database')} page.
109
114
 
110
115
  -----
111
116
  <a id="note1" href="#note1ref">&lt;1&gt;</a>: Currently, _flowR_ is only tested with R versions \`4.x\` and \`3.6.x\`.
112
117
 
113
118
  <a id="note2" href="#note2ref">&lt;2&gt;</a>: We use
114
- [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository for more information).
115
-
116
- [r-shell]: (https://github.com/flowr-analysis/flowr/wiki/Engines)
119
+ [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md) in the repository for more information).
117
120
  `.trim();
118
121
  }
119
122
  }
@@ -0,0 +1,16 @@
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/Package-Database
5
+ */
6
+ export declare class WikiSignatureDatabase extends DocMaker<'wiki/Signature Database.md'> {
7
+ constructor();
8
+ /**
9
+ * Regenerate only when the CRAN shards are actually present. A fresh checkout (and every CI run) ships no shards
10
+ * at all until they are downloaded, and this page documents the *CRAN* database: regenerating without them would
11
+ * replace the shard table and figures with empty/base-only numbers and publish that over the real page. Skipping
12
+ * leaves the committed page untouched, so the workflow reports no change and publishes nothing.
13
+ */
14
+ make(args: Parameters<DocMaker<'wiki/Signature Database.md'>['make']>[0]): Promise<boolean>;
15
+ text({ ctx }: DocMakerArgs): Promise<string>;
16
+ }
@@ -0,0 +1,293 @@
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.WikiSignatureDatabase = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const zlib_1 = __importDefault(require("zlib"));
10
+ const doc_maker_1 = require("./wiki-mk/doc-maker");
11
+ const doc_files_1 = require("./doc-util/doc-files");
12
+ const reader_1 = require("../project/sigdb/reader");
13
+ const schema_1 = require("../project/sigdb/schema");
14
+ const manifest_1 = require("../project/sigdb/manifest");
15
+ const config_1 = require("../config");
16
+ const flowr_analyzer_package_versions_sigdb_plugin_1 = require("../project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin");
17
+ const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
18
+ function cranDatabaseAvailable() {
19
+ return (0, manifest_1.defaultSigDbPath)('current') !== undefined || (0, manifest_1.defaultSigDbPath)('full') !== undefined;
20
+ }
21
+ /** point the resolver at your own database (a file path or manifest) */
22
+ function usePackageDatabase(parser) {
23
+ const sigdb = new flowr_analyzer_package_versions_sigdb_plugin_1.FlowrAnalyzerPackageVersionsSigDbPlugin('/path/to/sigs.manifest.json.br');
24
+ return new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setParser(parser).registerPlugins(sigdb).build();
25
+ }
26
+ /** a coarse duration in short units (`µs`/`ms`); we only ever quote estimates, never false precision */
27
+ function roughDuration(ms) {
28
+ if (ms < 0.001) {
29
+ return '<1 µs';
30
+ }
31
+ if (ms < 1) {
32
+ return `${Number((ms * 1000).toPrecision(2))} µs`;
33
+ }
34
+ return `${Number(ms.toPrecision(2))} ms`;
35
+ }
36
+ async function measurePerformance() {
37
+ const src = (0, manifest_1.defaultSigDbPath)();
38
+ if (src === undefined) {
39
+ return undefined;
40
+ }
41
+ try {
42
+ const t0 = Date.now();
43
+ const db = src.endsWith('.manifest.json') || src.endsWith('.manifest.json.br')
44
+ ? await reader_1.SigDatabaseSet.openManifest(src)
45
+ : await reader_1.SigDatabase.open(src);
46
+ const loadMs = Date.now() - t0;
47
+ const names = db.packageNames();
48
+ const sample = [0, 0.25, 0.5, 0.75, 0.99].map(f => names[Math.min(names.length - 1, Math.floor(f * names.length))]);
49
+ for (const n of sample) {
50
+ db.lookup(n);
51
+ }
52
+ const iterations = sample.length * 4;
53
+ const t1 = process.hrtime.bigint();
54
+ for (let i = 0; i < iterations; i++) {
55
+ db.lookup(sample[i % sample.length]);
56
+ }
57
+ const perLookupMs = Number(process.hrtime.bigint() - t1) / iterations / 1e6;
58
+ db.close();
59
+ return `Measured here at generation time: opening the bundle took ${roughDuration(loadMs)}, and a warmed`
60
+ + ` per-package export lookup takes ${roughDuration(perLookupMs)}. Each \`library()\` or \`::\` in a script`
61
+ + ' is then one cached lookup.';
62
+ }
63
+ catch {
64
+ return undefined;
65
+ }
66
+ }
67
+ /** group an integer into thousands with commas, deterministically (locale-independent) */
68
+ function groupThousands(n) {
69
+ return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
70
+ }
71
+ /** a coarse, human-readable byte size (`.br` sizes only ever quoted approximately) */
72
+ function humanBytes(bytes) {
73
+ if (bytes < 1024) {
74
+ return `${bytes} B`;
75
+ }
76
+ const kb = bytes / 1024;
77
+ if (kb < 1024) {
78
+ return `${Math.round(kb)} KB`;
79
+ }
80
+ return `${(kb / 1024).toFixed(1)} MB`;
81
+ }
82
+ /** what a shard holds, derived from its id and popularity split (base R, the top-N CRAN packages, or the rest) */
83
+ function shardContents(s) {
84
+ if (s.id.startsWith('base')) {
85
+ return 'base-R packages (`base`, `stats`, `graphics`, ...)';
86
+ }
87
+ if (s.shard === 'top') {
88
+ return `the ${groupThousands(s.topN ?? s.packages)} most-downloaded CRAN packages`;
89
+ }
90
+ if (s.shard === 'rest') {
91
+ return 'the remaining CRAN packages';
92
+ }
93
+ return 'CRAN packages';
94
+ }
95
+ /** how many versions a tier keeps per package */
96
+ function tierHistory(s) {
97
+ return s.tier === 'current' ? 'latest only' : 'full history';
98
+ }
99
+ /** resolve a manifest-relative source to its shipped file, preferring the compressed `.br` */
100
+ function resolveShipped(baseDir, rel) {
101
+ for (const candidate of [path_1.default.resolve(baseDir, rel + '.br'), path_1.default.resolve(baseDir, rel)]) {
102
+ if (fs_1.default.existsSync(candidate)) {
103
+ return candidate;
104
+ }
105
+ }
106
+ return undefined;
107
+ }
108
+ /** time (at generation time) how long it takes to decompress one shipped `.br`, i.e. its first-touch load cost */
109
+ function measureLoad(file) {
110
+ if (!file.endsWith('.br')) {
111
+ return undefined;
112
+ }
113
+ try {
114
+ const raw = fs_1.default.readFileSync(file);
115
+ const t0 = Date.now();
116
+ zlib_1.default.brotliDecompressSync(raw, { params: { [zlib_1.default.constants.BROTLI_DECODER_PARAM_LARGE_WINDOW]: 1 } });
117
+ return Date.now() - t0;
118
+ }
119
+ catch {
120
+ return undefined;
121
+ }
122
+ }
123
+ /**
124
+ * A table of the databases the default bundle actually ships, read -- at generation time, never hardcoded --
125
+ * from the manifests. Each shard becomes a row (contents, retained history, package and version counts, its
126
+ * on-disk size, and the measured cost of decompressing it on first touch). Every bundled manifest is unioned
127
+ * (deduped by shard/dictionary id), so the separate `history` manifest's shards show up alongside `current`,
128
+ * matching what the runtime actually mounts. `undefined` when no bundled manifest is present (e.g. a checkout
129
+ * without generated data).
130
+ */
131
+ function bundledDatabaseTable() {
132
+ const manifestPaths = (0, manifest_1.defaultSigDbPaths)().filter(p => /\.manifest\.json(\.br)?$/.test(p));
133
+ if (manifestPaths.length === 0) {
134
+ return undefined;
135
+ }
136
+ const sizeOf = (file) => file ? humanBytes(fs_1.default.statSync(file).size) : 'n/a';
137
+ const loadOf = (file) => {
138
+ const load = file ? measureLoad(file) : undefined;
139
+ return load !== undefined ? `≈ ${roughDuration(load)}` : 'n/a';
140
+ };
141
+ const shardRows = [];
142
+ const dictRows = [];
143
+ const seenShards = new Set();
144
+ const seenDicts = new Set();
145
+ for (const manifestPath of manifestPaths) {
146
+ let shards;
147
+ let dicts;
148
+ try {
149
+ const manifest = (0, manifest_1.readManifestFile)(manifestPath);
150
+ shards = manifest.shards;
151
+ dicts = manifest.dicts ?? [];
152
+ }
153
+ catch {
154
+ continue;
155
+ }
156
+ const baseDir = path_1.default.dirname(manifestPath);
157
+ for (const s of shards) {
158
+ if (seenShards.has(s.id)) {
159
+ continue;
160
+ }
161
+ seenShards.add(s.id);
162
+ const file = resolveShipped(baseDir, s.path);
163
+ shardRows.push(`| \`${s.id}\` | ${shardContents(s)} | ${tierHistory(s)} | ${groupThousands(s.packages)} | ${groupThousands(s.versions)} | ${sizeOf(file)} | ${loadOf(file)} |`);
164
+ }
165
+ for (const d of dicts) {
166
+ // every manifest names its dict id `shared`; the files differ per scope, so dedupe (and label) by path
167
+ if (seenDicts.has(d.path)) {
168
+ continue;
169
+ }
170
+ seenDicts.add(d.path);
171
+ const file = resolveShipped(baseDir, d.path);
172
+ const label = path_1.default.basename(d.path).replace(/\.sigs\.ndjson$/, '');
173
+ dictRows.push(`| \`${label}\` | ${groupThousands(d.strings)} shared strings | - | - | - | ${sizeOf(file)} | ${loadOf(file)} |`);
174
+ }
175
+ }
176
+ if (shardRows.length === 0) {
177
+ return undefined;
178
+ }
179
+ return `| Shard | Contents | Versions kept | Packages | Versions | Size (\`.br\`) | Load (first touch) |
180
+ |-------|----------|---------------|---------:|---------:|-------------:|-------------------:|
181
+ ${[...shardRows, ...dictRows].join('\n')}`;
182
+ }
183
+ /** link a built-in plugin key (e.g. `versions:sigdb`) to its registration */
184
+ function pluginLink(key) {
185
+ return `[\`${key}\`](${doc_files_1.RemoteFlowrFilePathBaseRef}src/project/plugins/plugin-registry.ts)`;
186
+ }
187
+ /**
188
+ * https://github.com/flowr-analysis/flowr/wiki/Package-Database
189
+ */
190
+ class WikiSignatureDatabase extends doc_maker_1.DocMaker {
191
+ constructor() {
192
+ super('wiki/Signature Database.md', module.filename, 'bundled signature database that resolves `library()` calls');
193
+ }
194
+ /**
195
+ * Regenerate only when the CRAN shards are actually present. A fresh checkout (and every CI run) ships no shards
196
+ * at all until they are downloaded, and this page documents the *CRAN* database: regenerating without them would
197
+ * replace the shard table and figures with empty/base-only numbers and publish that over the real page. Skipping
198
+ * leaves the committed page untouched, so the workflow reports no change and publishes nothing.
199
+ */
200
+ async make(args) {
201
+ if (!cranDatabaseAvailable()) {
202
+ console.log(` [${this.getTarget()}] skipped: no CRAN sigdb present (not downloaded); keeping the committed page`);
203
+ return false;
204
+ }
205
+ return super.make(args);
206
+ }
207
+ async text({ ctx }) {
208
+ const performance = await measurePerformance();
209
+ const databases = bundledDatabaseTable();
210
+ return `
211
+
212
+ # Signature Database
213
+
214
+ flowR ships a database of the complete history of all exports in every version of all CRAN packages so it can resolve calls into the packages you load.
215
+ After \`library(ggplot2)\`, a call to \`ggplot()\` resolves to \`ggplot2::ggplot\`. The same database
216
+ qualifies bare names and backs various components like the ${ctx.linkPage('wiki/Query API', 'dependencies and call-context queries')}
217
+ as well as the ${ctx.linkPage('wiki/Linter', 'undefined symbol')} rule.
218
+
219
+ ## Configuration
220
+
221
+ The exports come from ${pluginLink('versions:sigdb')}, which reads bundled databases. It is enabled by
222
+ default (see ${ctx.linkPage('wiki/Interface', 'configuring flowR', 'configuring-flowr')}).
223
+
224
+ *Which* version's exports get resolved is decided by the version-reading plugins that pin the packages a
225
+ project uses.
226
+
227
+ ${ctx.code(usePackageDatabase, { dropLinesStart: 1 })}
228
+
229
+ File sources load lazily on the first package load, so a script with no \`library()\` or \`use()\` calls
230
+ never pays to parse them. Set ${ctx.linkConfig('solver.sigdb.eagerlyLoad')} to mount the database up front instead, or
231
+ ${ctx.linkConfig('solver.sigdb.enabled')} to \`false\` to switch it off entirely. For a compressed (\`.br\`) or manifest source,
232
+ ${ctx.linkM(flowr_analyzer_package_versions_sigdb_plugin_1.FlowrAnalyzerPackageVersionsSigDbPlugin, 'preload', { hideClass: true })} it before analysis to mount it.
233
+
234
+ The base-R packages (\`base\`, \`stats\`, \`graphics\`, ...) resolve against an assumed R version, which
235
+ defaults to \`${config_1.DefaultAssumedRVersion}\` (${ctx.linkConfig('solver.sigdb.assumedRVersion')}, or \`"auto"\` to detect the local R).
236
+ So \`library(stats)\` attaches that release's exports, and a bare \`sd()\` qualifies to \`stats::sd\` even
237
+ without attaching the base namespaces to the graph. Set ${ctx.linkConfig('solver.sigdb.linkBaseR')} to also link them as
238
+ dataflow edges.
239
+
240
+ **No** signature shards are committed: the \`base.*\` floor (self-contained base-R signatures, a few hundred KB), the
241
+ \`current.*\` scope (every package's latest version) and \`history.*\` (every older version) all live as assets on the
242
+ free ${ctx.linkConfig('solver.sigdb.downloadRepo')} GitHub release. The only committed file is a tiny **link file**,
243
+ \`src/data/sigdb/sigdb.remote.json\`, which records the release tag and each shard's sha256 and size, so
244
+ \`:signature download\` builds the direct release-CDN URL (no API rate limit), verifies every shard by content hash,
245
+ and skips any already cached. Because the link file is versioned, a \`git pull\` that updates it re-syncs only the
246
+ shards whose hash changed &mdash; and with ${ctx.linkConfig('solver.sigdb.autoSync')} that check runs on startup and re-downloads in the
247
+ background; \`npm run build\` bakes the shards in as well. The richest downloaded scope is used (order \`full\` >
248
+ \`current\` > \`base\`), so once fetched \`library(stats)\` resolves. Any path in ${ctx.linkConfig('solver.sigdb.additionalPaths')} (or
249
+ \`$FLOWR_SIGDB_DIR\`) is searched alongside the default, so a downloaded bundle stays mounted on every start.
250
+ ${databases ? `
251
+ ## Bundled Databases
252
+
253
+ The default bundle is not a single file but a set of shards that a manifest routes between (see
254
+ ${ctx.link(reader_1.SigDatabaseSet)}). Nothing is read when the manifest opens. The first lookup of a package
255
+ decompresses only the one shard that holds it, plus the shared dictionary once. The following ship with this
256
+ build; the load column is the decompression time measured at generation time.
257
+
258
+ ${databases}
259
+
260
+ Which shard answers a lookup follows from the package and the version asked for. A base-R package comes from
261
+ \`base-current\`, one of the 1,000 most-downloaded CRAN packages from \`current-top\`, and anything else from
262
+ \`current-rest\`. The \`*-full\` and \`history-*\` shards hold every historical version and are only touched when
263
+ an older, pinned version is requested, so a normal analysis never decompresses them. Each scope carries its own
264
+ shared dictionary that its shards depend on, so it is decompressed the first time any of its packages is looked up and then reused.
265
+ The flowR Docker images ship this dictionary already decompressed, so a container reads it in place and skips
266
+ that step (the load column above is the cost a plain npm install pays).
267
+
268
+ Every shard, dictionary, and manifest is published in both brotli (\`.br\`) and zstd (\`.zst\`, faster to decompress) compression, and flowR uses whichever the runtime supports: \`.zst\` when the Node version exposes [zstd](https://nodejs.org/api/zlib.html#zstd) (Node &ge; 22.15), otherwise \`.br\`. \`:signature download\` fetches only that one variant per file, and \`:version\` reports the format each loaded database resolved to.
269
+ ` : ''}
270
+ ## Format
271
+
272
+ The on-disk format is \`flowr-sigdb\` (schema ${schema_1.SigDbSchema}). Beyond each version's exports it records, per
273
+ version, every function's signature (parameters, whether each is forced or optional, and its default) and
274
+ call graph, together with that version's declared dependencies (\`Depends\`, \`Imports\`, ... with their
275
+ version qualifiers). The layout is NDJSON: a header, then a shared string dictionary, then one
276
+ self-contained blob per package, next to a sidecar \`.idx\`. A reader (${ctx.link(reader_1.SigDatabase)}) therefore
277
+ loads the dictionary once and then **seeks straight to the packages it needs**, never reading the rest.
278
+ The bundle is written by ${ctx.link('SigDbBuilder')} and can be split into several small shards (current-only
279
+ versus full history, top-N versus the rest) that a \`flowr-sigdb-manifest\` routes transparently
280
+ (${ctx.link(reader_1.SigDatabaseSet)}), and which information gets stored is selectable (${ctx.link('SigDbFeatures')}).
281
+ crawlr produces the bundle from its analysis of CRAN.
282
+
283
+ ## Performance
284
+
285
+ The dictionary is read once, the reader then seeks straight to each requested package, and consumers cache
286
+ what they derive (the \`base\`-package list is precomputed when flowR is bundled, so it costs nothing at
287
+ analysis time). ${performance ??
288
+ 'After the one-time load a per-package lookup is O(1), so each `library()` or `::` a script uses is a single cached lookup.'}
289
+ `.trim();
290
+ }
291
+ }
292
+ exports.WikiSignatureDatabase = WikiSignatureDatabase;
293
+ //# sourceMappingURL=wiki-signature-database.js.map
@@ -31,6 +31,13 @@ export interface LinterRuleInformation<Config extends MergeableRecord = never> {
31
31
  * This is used to display the rule in the UI and to provide a brief overview of what the rule does.
32
32
  */
33
33
  readonly description: string;
34
+ /**
35
+ * Whether the rule runs when a linter query does not explicitly list any rules.
36
+ * Defaults to `true` when omitted. Set to `false` for noisy or heuristic rules
37
+ * that should only run when requested explicitly (an explicit rule list overrides this flag).
38
+ * @see {@link executeLinterQuery} - reads this flag to pick the default rule set
39
+ */
40
+ readonly activeByDefault?: boolean;
34
41
  }
35
42
  /**
36
43
  * The base interface for a linting rule, which contains all of its relevant settings.
@@ -125,6 +125,7 @@ export declare const LintingRules: {
125
125
  readonly certainty: import("./linter-format").LintingRuleCertainty.BestEffort;
126
126
  readonly defaultConfig: {
127
127
  readonly includeFunctionDefinitions: true;
128
+ readonly excludeExportedDefinitions: true;
128
129
  };
129
130
  };
130
131
  };
@@ -146,6 +147,7 @@ export declare const LintingRules: {
146
147
  readonly certainty: import("./linter-format").LintingRuleCertainty.OverApproximative;
147
148
  readonly description: "Checks whether the symbols conform to a certain naming convention";
148
149
  readonly tags: readonly [import("./linter-tags").LintingRuleTag.Style, import("./linter-tags").LintingRuleTag.QuickFix];
150
+ readonly activeByDefault: false;
149
151
  readonly defaultConfig: {
150
152
  readonly caseing: "auto";
151
153
  readonly ignoreNonAlpha: true;
@@ -359,13 +361,8 @@ export declare const LintingRules: {
359
361
  };
360
362
  readonly 'undefined-symbol': {
361
363
  readonly createSearch: (_config: import("./rules/undefined-symbol").UndefinedSymbolConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, Promise<import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, [] | import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>>;
362
- readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("../util/objects").MergeableRecord, data: import("../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>) => Promise<{
363
- results: {
364
- certainty: import("./linter-format").LintingResultCertainty.Uncertain;
365
- name: import("../dataflow/environments/identifier").BrandedIdentifier;
366
- involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
367
- loc: [startLine: number, startColumn: number, endLine: number, endColumn: number, f?: string | undefined];
368
- }[];
364
+ readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/undefined-symbol").UndefinedSymbolConfig, data: import("../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>) => Promise<{
365
+ results: import("./rules/undefined-symbol").UndefinedSymbolResult[];
369
366
  '.meta': import("./rules/undefined-symbol").UndefinedSymbolMetadata;
370
367
  }>;
371
368
  readonly prettyPrint: {
@@ -375,9 +372,13 @@ export declare const LintingRules: {
375
372
  readonly info: {
376
373
  readonly name: "Undefined Symbol";
377
374
  readonly certainty: import("./linter-format").LintingRuleCertainty.OverApproximative;
378
- readonly description: "Flags calls to functions that are neither defined locally, a known builtin, nor exported by a loaded package.";
375
+ readonly description: "Flags functions and variables that are neither defined locally, a base R builtin, nor exported by a loaded package.";
379
376
  readonly tags: readonly [import("./linter-tags").LintingRuleTag.Bug, import("./linter-tags").LintingRuleTag.Experimental];
380
- readonly defaultConfig: {};
377
+ readonly defaultConfig: {
378
+ readonly checkFunctions: true;
379
+ readonly checkVariables: true;
380
+ readonly checkSubscripts: false;
381
+ };
381
382
  };
382
383
  };
383
384
  };
@@ -74,6 +74,7 @@ export declare const NAMING_CONVENTION: {
74
74
  readonly certainty: LintingRuleCertainty.OverApproximative;
75
75
  readonly description: "Checks whether the symbols conform to a certain naming convention";
76
76
  readonly tags: readonly [LintingRuleTag.Style, LintingRuleTag.QuickFix];
77
+ readonly activeByDefault: false;
77
78
  readonly defaultConfig: {
78
79
  readonly caseing: "auto";
79
80
  readonly ignoreNonAlpha: true;
@@ -197,6 +197,8 @@ exports.NAMING_CONVENTION = {
197
197
  certainty: linter_format_1.LintingRuleCertainty.OverApproximative,
198
198
  description: 'Checks whether the symbols conform to a certain naming convention',
199
199
  tags: [linter_tags_1.LintingRuleTag.Style, linter_tags_1.LintingRuleTag.QuickFix],
200
+ // heuristic and noisy on real package code, so only run when requested explicitly
201
+ activeByDefault: false,
200
202
  defaultConfig: {
201
203
  caseing: 'auto',
202
204
  ignoreNonAlpha: true
@@ -5,7 +5,6 @@ const linter_format_1 = require("../linter-format");
5
5
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
6
6
  const range_1 = require("../../util/range");
7
7
  const linter_tags_1 = require("../linter-tags");
8
- const assert_1 = require("../../util/assert");
9
8
  const vertex_1 = require("../../dataflow/graph/vertex");
10
9
  const edge_1 = require("../../dataflow/graph/edge");
11
10
  const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
@@ -54,7 +53,7 @@ exports.NO_LEAKED_CREDENTIALS = {
54
53
  }
55
54
  }
56
55
  return [];
57
- }).filter(assert_1.isNotUndefined);
56
+ });
58
57
  return { results, '.meta': { totalChecked } };
59
58
  },
60
59
  prettyPrint: {
@@ -53,9 +53,6 @@ exports.ROXYGEN_ARGS = {
53
53
  const functionParamNames = getParameters(element.node).map(p => p.name.content.toString());
54
54
  const inheritedParams = params.filter(tag => tag.inherited).map(tag => tag.value.name);
55
55
  const roxygenParamNames = params.map(tag => tag.value.name);
56
- if (functionParamNames === null || roxygenParamNames == null) {
57
- return false;
58
- }
59
56
  const result = calculateArgumentDiff(inheritedParams ?? [], functionParamNames, roxygenParamNames);
60
57
  if (result === false) {
61
58
  return false;
@@ -76,8 +73,8 @@ exports.ROXYGEN_ARGS = {
76
73
  };
77
74
  },
78
75
  prettyPrint: {
79
- [linter_format_1.LintingPrettyPrintContext.Query]: result => `Code at ${range_1.SourceLocation.format(result.loc)}`,
80
- [linter_format_1.LintingPrettyPrintContext.Full]: result => `Code at ${range_1.SourceLocation.format(result.loc)} has undocumented parameters: ${result.underDocumented?.join()} and overdocumented parameters: ${result.overDocumented?.join()}`
76
+ [linter_format_1.LintingPrettyPrintContext.Query]: result => `Function at ${range_1.SourceLocation.format(result.loc)} has ${describeArgumentDiff(result)}`,
77
+ [linter_format_1.LintingPrettyPrintContext.Full]: result => `Function at ${range_1.SourceLocation.format(result.loc)} has ${describeArgumentDiff(result)}`
81
78
  },
82
79
  info: {
83
80
  name: 'Roxygen Arguments',
@@ -90,4 +87,20 @@ exports.ROXYGEN_ARGS = {
90
87
  function getParameters(node) {
91
88
  return r_function_definition_1.RFunctionDefinition.is(node) ? node.parameters : [];
92
89
  }
90
+ function quoteAll(names) {
91
+ return names.map(name => `'${name}'`).join(', ');
92
+ }
93
+ /** Describes the concrete mismatch between roxygen `@param` documentation and the actual function arguments. */
94
+ function describeArgumentDiff(result) {
95
+ const parts = [];
96
+ const under = result.underDocumented ?? [];
97
+ const over = result.overDocumented ?? [];
98
+ if (under.length > 0) {
99
+ parts.push(`undocumented argument${under.length > 1 ? 's' : ''} ${quoteAll(under)}`);
100
+ }
101
+ if (over.length > 0) {
102
+ parts.push(`documented @param${over.length > 1 ? 's' : ''} with no matching argument: ${quoteAll(over)}`);
103
+ }
104
+ return parts.join(', and ');
105
+ }
93
106
  //# sourceMappingURL=roxygen-arguments.js.map
@@ -59,8 +59,8 @@ exports.STOP_WITH_CALL_ARG = {
59
59
  };
60
60
  },
61
61
  prettyPrint: {
62
- [linter_format_1.LintingPrettyPrintContext.Query]: result => `Code at ${range_1.SourceLocation.format(result.loc)}`,
63
- [linter_format_1.LintingPrettyPrintContext.Full]: result => `Code at ${range_1.SourceLocation.format(result.loc)} does call stop without setting call. to FALSE`,
62
+ [linter_format_1.LintingPrettyPrintContext.Query]: result => `\`stop()\` without \`call. = FALSE\` at ${range_1.SourceLocation.format(result.loc)}`,
63
+ [linter_format_1.LintingPrettyPrintContext.Full]: result => `\`stop()\` at ${range_1.SourceLocation.format(result.loc)} is called without \`call. = FALSE\`; the originating call is then appended to the error message, which is usually not intended - pass \`call. = FALSE\` to suppress it`,
64
64
  },
65
65
  info: {
66
66
  name: 'Stop without call.=False argument',
@@ -0,0 +1,36 @@
1
+ import type { DataflowGraph } from '../../dataflow/graph/graph';
2
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
+ /**
4
+ * Path heuristic for an R package `inst/` resource (installed verbatim, not namespace source). Fallback for
5
+ * the authoritative `FileRole.Install`, covering requests that bypass the file-role plugins.
6
+ */
7
+ export declare function isInstalledResourceFile(file: string | undefined): boolean;
8
+ /**
9
+ * Whether the variable use `id` resolves to a local definition, a parameter, or a built-in (function or
10
+ * constant such as `T`, `pi`). Broader than `getOriginInDfg`, which misses built-in constants.
11
+ */
12
+ export declare function useResolvesToDefinitionOrBuiltin(graph: DataflowGraph, id: NodeId): boolean;
13
+ /** Whether any edge incident to `id` marks it as non-standard-evaluated (quoted), e.g. `quote`/`substitute`. */
14
+ export declare function isNonStandardEvaluated(graph: DataflowGraph, id: NodeId): boolean;
15
+ /**
16
+ * Whether the use `id` sits inside a `[`/`[[` subscript (not the accessed object). `data.table`'s
17
+ * `DT[i, j, by]` masks the subscript symbols as columns, but flowR cannot tell this apart from ordinary
18
+ * indexing (`x[i]`), so the rule suppresses subscript symbols by default. Stops at the enclosing function.
19
+ */
20
+ export declare function isInSubscript(graph: DataflowGraph, id: NodeId): boolean;
21
+ /** The lexical scope a definition/use belongs to: the id of the enclosing function definition, or the top level. */
22
+ export type Scope = NodeId | 'top';
23
+ /** Names bound unconditionally within each lexical scope, see {@link collectScopeDefinedNames}. */
24
+ export type ScopeDefinedNames = ReadonlyMap<Scope, ReadonlySet<string>>;
25
+ /**
26
+ * Per scope, the names it binds unconditionally. flowR's static resolution does not always link a use in a
27
+ * nested function to a binding introduced later in an enclosing scope; the rule consults this as a fallback.
28
+ * Only unconditional bindings are recorded: one assigned solely inside an `if`/loop is not guaranteed to
29
+ * exist, so suppressing an unresolved use of it would hide a real possibly-undefined access.
30
+ */
31
+ export declare function collectScopeDefinedNames(graph: DataflowGraph): ScopeDefinedNames;
32
+ /**
33
+ * Whether `name` is bound in the scope of `useId` or an enclosing scope (up to the top level), per
34
+ * {@link collectScopeDefinedNames}. Suppresses forward-referenced closure variables flowR did not link.
35
+ */
36
+ export declare function isDefinedInEnclosingScope(graph: DataflowGraph, defined: ScopeDefinedNames, useId: NodeId, name: string): boolean;