@eagleoutice/flowr 2.2.14 → 2.2.16
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 +210 -6
- package/benchmark/slicer.d.ts +3 -1
- package/benchmark/slicer.js +8 -5
- package/benchmark/summarizer/first-phase/process.d.ts +2 -1
- package/benchmark/summarizer/first-phase/process.js +2 -2
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +4 -1
- package/cli/benchmark-helper-app.d.ts +1 -0
- package/cli/benchmark-helper-app.js +7 -8
- package/cli/common/options.js +2 -0
- package/cli/export-quads-app.js +2 -1
- package/cli/flowr.js +58 -57
- package/cli/repl/commands/repl-cfg.js +13 -13
- package/cli/repl/commands/repl-commands.js +3 -3
- package/cli/repl/commands/repl-dataflow.js +10 -10
- package/cli/repl/commands/repl-execute.d.ts +2 -3
- package/cli/repl/commands/repl-execute.js +5 -4
- package/cli/repl/commands/repl-lineage.js +4 -4
- package/cli/repl/commands/repl-main.d.ts +12 -1
- package/cli/repl/commands/repl-normalize.js +6 -6
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +9 -9
- package/cli/repl/commands/repl-version.js +1 -1
- package/cli/repl/core.d.ts +5 -2
- package/cli/repl/core.js +10 -8
- package/cli/repl/server/connection.d.ts +3 -1
- package/cli/repl/server/connection.js +7 -5
- package/cli/repl/server/server.d.ts +3 -2
- package/cli/repl/server/server.js +4 -2
- package/cli/script-core/statistics-core.d.ts +2 -1
- package/cli/script-core/statistics-core.js +2 -2
- package/cli/script-core/statistics-helper-core.d.ts +2 -1
- package/cli/script-core/statistics-helper-core.js +5 -4
- package/cli/slicer-app.js +4 -2
- package/cli/statistics-app.js +2 -1
- package/cli/statistics-helper-app.js +2 -1
- package/config.d.ts +12 -10
- package/config.js +27 -43
- package/control-flow/basic-cfg-guided-visitor.d.ts +3 -3
- package/control-flow/cfg-dead-code.d.ts +4 -0
- package/control-flow/cfg-dead-code.js +124 -0
- package/control-flow/cfg-simplification.d.ts +19 -6
- package/control-flow/cfg-simplification.js +23 -19
- package/control-flow/control-flow-graph.d.ts +3 -1
- package/control-flow/control-flow-graph.js +5 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +9 -7
- package/control-flow/dfg-cfg-guided-visitor.js +16 -5
- package/control-flow/extract-cfg.d.ts +4 -2
- package/control-flow/extract-cfg.js +63 -59
- package/control-flow/semantic-cfg-guided-visitor.d.ts +36 -9
- package/control-flow/semantic-cfg-guided-visitor.js +73 -20
- package/control-flow/simple-visitor.d.ts +4 -0
- package/control-flow/simple-visitor.js +14 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -2
- package/core/pipeline-executor.d.ts +4 -1
- package/core/pipeline-executor.js +6 -5
- package/core/steps/all/core/10-normalize.d.ts +2 -0
- package/core/steps/all/core/10-normalize.js +1 -1
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -1
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -2
- package/core/steps/all/core/20-dataflow.d.ts +2 -1
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -1
- package/core/steps/all/static-slicing/00-slice.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +32 -31
- package/core/steps/pipeline/default-pipelines.js +8 -8
- package/core/steps/pipeline-step.d.ts +2 -1
- package/dataflow/environments/built-in-config.d.ts +4 -3
- package/dataflow/environments/built-in.d.ts +16 -1
- package/dataflow/environments/built-in.js +11 -5
- package/dataflow/environments/default-builtin-config.js +5 -3
- package/dataflow/environments/define.d.ts +2 -1
- package/dataflow/environments/define.js +4 -5
- package/dataflow/environments/remove.d.ts +6 -0
- package/dataflow/environments/remove.js +29 -0
- package/dataflow/environments/resolve-by-name.d.ts +0 -36
- package/dataflow/environments/resolve-by-name.js +0 -240
- package/dataflow/eval/resolve/alias-tracking.d.ts +92 -0
- package/dataflow/eval/resolve/alias-tracking.js +352 -0
- package/dataflow/eval/resolve/resolve-argument.d.ts +8 -0
- package/dataflow/eval/resolve/resolve-argument.js +118 -0
- package/dataflow/eval/resolve/resolve.d.ts +37 -0
- package/dataflow/eval/resolve/resolve.js +95 -0
- package/dataflow/eval/values/general.d.ts +27 -0
- package/dataflow/eval/values/general.js +73 -0
- package/dataflow/eval/values/intervals/interval-constants.d.ts +4 -0
- package/dataflow/eval/values/intervals/interval-constants.js +27 -0
- package/dataflow/eval/values/logical/logical-constants.d.ts +7 -0
- package/dataflow/eval/values/logical/logical-constants.js +31 -0
- package/dataflow/eval/values/r-value.d.ts +58 -0
- package/dataflow/eval/values/r-value.js +90 -0
- package/dataflow/eval/values/scalar/scalar-consatnts.d.ts +15 -0
- package/dataflow/eval/values/scalar/scalar-consatnts.js +35 -0
- package/dataflow/eval/values/sets/set-constants.d.ts +7 -0
- package/dataflow/eval/values/sets/set-constants.js +34 -0
- package/dataflow/eval/values/string/string-constants.d.ts +8 -0
- package/dataflow/eval/values/string/string-constants.js +45 -0
- package/dataflow/eval/values/vectors/vector-constants.d.ts +14 -0
- package/dataflow/eval/values/vectors/vector-constants.js +35 -0
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +2 -1
- package/dataflow/graph/unknown-replacement.d.ts +11 -0
- package/dataflow/graph/unknown-replacement.js +12 -0
- package/dataflow/graph/unknown-side-effect.d.ts +7 -0
- package/dataflow/graph/unknown-side-effect.js +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +8 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +15 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +20 -18
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +11 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +26 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +23 -0
- package/dataflow/internal/process/functions/call/common.js +1 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +21 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +50 -0
- package/dataflow/processor.d.ts +5 -0
- package/documentation/doc-util/doc-cfg.js +4 -3
- package/documentation/doc-util/doc-code.d.ts +1 -1
- package/documentation/doc-util/doc-dfg.js +3 -2
- package/documentation/doc-util/doc-functions.d.ts +24 -0
- package/documentation/doc-util/doc-functions.js +65 -0
- package/documentation/doc-util/doc-normalized-ast.js +3 -2
- package/documentation/doc-util/doc-print.d.ts +5 -0
- package/documentation/doc-util/doc-print.js +36 -0
- package/documentation/doc-util/doc-query.d.ts +6 -3
- package/documentation/doc-util/doc-query.js +6 -3
- package/documentation/doc-util/doc-repl.js +2 -1
- package/documentation/doc-util/doc-search.js +3 -2
- package/documentation/doc-util/doc-types.d.ts +28 -6
- package/documentation/doc-util/doc-types.js +89 -45
- package/documentation/print-cfg-wiki.js +10 -11
- package/documentation/print-core-wiki.js +5 -5
- package/documentation/print-dataflow-graph-wiki.js +14 -13
- package/documentation/print-engines-wiki.js +2 -3
- package/documentation/print-faq-wiki.js +8 -2
- package/documentation/print-interface-wiki.js +1 -2
- package/documentation/print-linter-issue.d.ts +1 -0
- package/documentation/print-linter-issue.js +71 -0
- package/documentation/print-linter-wiki.js +219 -34
- package/documentation/print-linting-and-testing-wiki.js +2 -4
- package/documentation/print-normalized-ast-wiki.js +3 -3
- package/documentation/print-query-wiki.js +81 -2
- package/documentation/print-readme.js +24 -1
- package/documentation/print-search-wiki.js +1 -2
- package/linter/linter-executor.d.ts +3 -1
- package/linter/linter-executor.js +3 -2
- package/linter/linter-format.d.ts +67 -7
- package/linter/linter-format.js +12 -1
- package/linter/linter-rules.d.ts +155 -16
- package/linter/linter-rules.js +12 -4
- package/linter/linter-tags.d.ts +80 -0
- package/linter/linter-tags.js +85 -0
- package/linter/rules/absolute-path.d.ts +71 -0
- package/linter/rules/absolute-path.js +177 -0
- package/linter/rules/deprecated-functions.d.ts +43 -0
- package/linter/rules/deprecated-functions.js +58 -0
- package/linter/rules/{2-file-path-validity.d.ts → file-path-validity.d.ts} +16 -6
- package/linter/rules/{2-file-path-validity.js → file-path-validity.js} +21 -13
- package/linter/rules/naming-convention.d.ts +71 -0
- package/linter/rules/naming-convention.js +164 -0
- package/linter/rules/seeded-randomness.d.ts +65 -0
- package/linter/rules/seeded-randomness.js +122 -0
- package/linter/rules/unused-definition.d.ts +41 -0
- package/linter/rules/unused-definition.js +105 -0
- package/package.json +4 -1
- package/queries/base-query-format.d.ts +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +2 -3
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +3 -0
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +20 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +81 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +34 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -115
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.js +17 -12
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -4
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +3 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -22
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/query.d.ts +75 -15
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +4 -2
- package/r-bridge/lang-4.x/convert-values.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +18 -9
- package/r-bridge/shell.d.ts +3 -2
- package/r-bridge/shell.js +4 -5
- package/search/flowr-search-builder.d.ts +6 -2
- package/search/flowr-search-builder.js +7 -0
- package/search/flowr-search-filters.d.ts +32 -8
- package/search/flowr-search-filters.js +42 -15
- package/search/flowr-search.d.ts +4 -0
- package/search/search-executor/search-enrichers.d.ts +7 -3
- package/search/search-executor/search-enrichers.js +32 -20
- package/search/search-executor/search-generators.js +1 -1
- package/search/search-executor/search-transformer.d.ts +2 -0
- package/search/search-executor/search-transformer.js +10 -1
- package/slicing/criterion/parse.d.ts +8 -0
- package/slicing/criterion/parse.js +20 -0
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +2 -3
- package/statistics/statistics.d.ts +3 -1
- package/statistics/statistics.js +5 -4
- package/util/containers.d.ts +12 -9
- package/util/containers.js +12 -9
- package/util/objects.d.ts +5 -4
- package/util/range.d.ts +5 -1
- package/util/range.js +11 -3
- package/util/text/strings.d.ts +6 -0
- package/util/text/strings.js +35 -0
- package/util/version.js +1 -1
- package/linter/rules/1-deprecated-functions.d.ts +0 -34
- package/linter/rules/1-deprecated-functions.js +0 -54
|
@@ -6,7 +6,28 @@ import type { TransformerNames } from '../search/search-executor/search-transfor
|
|
|
6
6
|
import type { NormalizedAst, ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
7
7
|
import type { LintingRuleConfig, LintingRuleMetadata, LintingRuleNames, LintingRuleResult } from './linter-rules';
|
|
8
8
|
import type { DataflowInformation } from '../dataflow/info';
|
|
9
|
-
import type {
|
|
9
|
+
import type { FlowrConfigOptions } from '../config';
|
|
10
|
+
import type { DeepPartial, DeepReadonly } from 'ts-essentials';
|
|
11
|
+
import type { LintingRuleTag } from './linter-tags';
|
|
12
|
+
import type { SourceRange } from '../util/range';
|
|
13
|
+
export interface LinterRuleInformation<Config extends MergeableRecord = never> {
|
|
14
|
+
/** Human-Readable name of the linting rule. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The default config for this linting rule.
|
|
18
|
+
* This config is combined with the user config when executing the rule.
|
|
19
|
+
*/
|
|
20
|
+
readonly defaultConfig: NoInfer<DeepReadonly<Config>>;
|
|
21
|
+
/**
|
|
22
|
+
* A short list of tags that describe and categorize the linting rule.
|
|
23
|
+
*/
|
|
24
|
+
readonly tags: readonly LintingRuleTag[];
|
|
25
|
+
/**
|
|
26
|
+
* A short description of the linting rule.
|
|
27
|
+
* This is used to display the rule in the UI and to provide a brief overview of what the rule does.
|
|
28
|
+
*/
|
|
29
|
+
readonly description: string;
|
|
30
|
+
}
|
|
10
31
|
/**
|
|
11
32
|
* The base interface for a linting rule, which contains all of its relevant settings.
|
|
12
33
|
* The registry of valid linting rules is stored in {@link LintingRules}.
|
|
@@ -27,26 +48,54 @@ export interface LintingRule<Result extends LintingResult, Metadata extends Merg
|
|
|
27
48
|
readonly processSearchResult: (elements: FlowrSearchElements<Info, Elements>, config: Config, data: {
|
|
28
49
|
normalize: NormalizedAst;
|
|
29
50
|
dataflow: DataflowInformation;
|
|
51
|
+
config: FlowrConfigOptions;
|
|
30
52
|
}) => {
|
|
31
53
|
results: Result[];
|
|
32
54
|
'.meta': Metadata;
|
|
33
55
|
};
|
|
34
56
|
/**
|
|
35
|
-
* A
|
|
36
|
-
* By default, the {@link LintingResult#certainty} is automatically printed alongside this information.
|
|
57
|
+
* A set of functions used to pretty-print the given linting result.
|
|
58
|
+
* By default, the {@link LintingResult#certainty} and whether any {@link LintingResult#quickFix} values are available is automatically printed alongside this information.
|
|
59
|
+
*/
|
|
60
|
+
readonly prettyPrint: {
|
|
61
|
+
[C in LintingPrettyPrintContext]: (result: Result, metadata: Metadata) => string;
|
|
62
|
+
};
|
|
63
|
+
readonly info: LinterRuleInformation<NoInfer<Config>>;
|
|
64
|
+
}
|
|
65
|
+
interface BaseQuickFix {
|
|
66
|
+
/**
|
|
67
|
+
* The type of the quick fix.
|
|
37
68
|
*/
|
|
38
|
-
readonly
|
|
69
|
+
readonly type: string;
|
|
39
70
|
/**
|
|
40
|
-
*
|
|
41
|
-
* The default config is combined with the user config when executing the rule.
|
|
71
|
+
* A short, human-readable description of the quick fix.
|
|
42
72
|
*/
|
|
43
|
-
readonly
|
|
73
|
+
readonly description: string;
|
|
74
|
+
/**
|
|
75
|
+
* The range of the text that should be replaced.
|
|
76
|
+
*/
|
|
77
|
+
readonly range: SourceRange;
|
|
44
78
|
}
|
|
79
|
+
export interface LintQuickFixReplacement extends BaseQuickFix {
|
|
80
|
+
readonly type: 'replace';
|
|
81
|
+
/**
|
|
82
|
+
* The text that should replace the given range.
|
|
83
|
+
*/
|
|
84
|
+
readonly replacement: string;
|
|
85
|
+
}
|
|
86
|
+
export interface LintQuickFixRemove extends BaseQuickFix {
|
|
87
|
+
readonly type: 'remove';
|
|
88
|
+
}
|
|
89
|
+
export type LintQuickFix = LintQuickFixReplacement | LintQuickFixRemove;
|
|
45
90
|
/**
|
|
46
91
|
* A linting result for a single linting rule match.
|
|
47
92
|
*/
|
|
48
93
|
export interface LintingResult {
|
|
49
94
|
readonly certainty: LintingCertainty;
|
|
95
|
+
/**
|
|
96
|
+
* If available, what to do to fix the linting result.
|
|
97
|
+
*/
|
|
98
|
+
readonly quickFix?: LintQuickFix[];
|
|
50
99
|
}
|
|
51
100
|
export interface ConfiguredLintingRule<Name extends LintingRuleNames = LintingRuleNames> {
|
|
52
101
|
readonly name: Name;
|
|
@@ -60,6 +109,17 @@ export interface LintingResults<Name extends LintingRuleNames> {
|
|
|
60
109
|
};
|
|
61
110
|
}
|
|
62
111
|
export declare enum LintingCertainty {
|
|
112
|
+
/**
|
|
113
|
+
* The linting rule cannot say for sure whether the result is correct or not.
|
|
114
|
+
*/
|
|
63
115
|
Maybe = "maybe",
|
|
116
|
+
/**
|
|
117
|
+
* The linting rule is certain that the reported lint is real.
|
|
118
|
+
*/
|
|
64
119
|
Definitely = "definitely"
|
|
65
120
|
}
|
|
121
|
+
export declare enum LintingPrettyPrintContext {
|
|
122
|
+
Query = "query",
|
|
123
|
+
Full = "full"
|
|
124
|
+
}
|
|
125
|
+
export {};
|
package/linter/linter-format.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LintingCertainty = void 0;
|
|
3
|
+
exports.LintingPrettyPrintContext = exports.LintingCertainty = void 0;
|
|
4
4
|
var LintingCertainty;
|
|
5
5
|
(function (LintingCertainty) {
|
|
6
|
+
/**
|
|
7
|
+
* The linting rule cannot say for sure whether the result is correct or not.
|
|
8
|
+
*/
|
|
6
9
|
LintingCertainty["Maybe"] = "maybe";
|
|
10
|
+
/**
|
|
11
|
+
* The linting rule is certain that the reported lint is real.
|
|
12
|
+
*/
|
|
7
13
|
LintingCertainty["Definitely"] = "definitely";
|
|
8
14
|
})(LintingCertainty || (exports.LintingCertainty = LintingCertainty = {}));
|
|
15
|
+
var LintingPrettyPrintContext;
|
|
16
|
+
(function (LintingPrettyPrintContext) {
|
|
17
|
+
LintingPrettyPrintContext["Query"] = "query";
|
|
18
|
+
LintingPrettyPrintContext["Full"] = "full";
|
|
19
|
+
})(LintingPrettyPrintContext || (exports.LintingPrettyPrintContext = LintingPrettyPrintContext = {}));
|
|
9
20
|
//# sourceMappingURL=linter-format.js.map
|
package/linter/linter-rules.d.ts
CHANGED
|
@@ -5,34 +5,173 @@ import type { LintingRule } from './linter-format';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const LintingRules: {
|
|
7
7
|
readonly 'deprecated-functions': {
|
|
8
|
-
readonly createSearch: (
|
|
9
|
-
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>[]
|
|
8
|
+
readonly createSearch: (config: import("./rules/deprecated-functions").DeprecatedFunctionsConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, 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>[]>>;
|
|
9
|
+
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>[]>) => {
|
|
10
10
|
results: {
|
|
11
11
|
certainty: import("./linter-format").LintingCertainty.Definitely;
|
|
12
12
|
function: import("../dataflow/environments/identifier").Identifier;
|
|
13
13
|
range: import("../util/range").SourceRange;
|
|
14
14
|
}[];
|
|
15
|
-
'.meta': import("./rules/
|
|
15
|
+
'.meta': import("./rules/deprecated-functions").DeprecatedFunctionsMetadata;
|
|
16
16
|
};
|
|
17
|
-
readonly prettyPrint:
|
|
18
|
-
|
|
19
|
-
readonly
|
|
17
|
+
readonly prettyPrint: {
|
|
18
|
+
readonly query: (result: import("./rules/deprecated-functions").DeprecatedFunctionsResult) => string;
|
|
19
|
+
readonly full: (result: import("./rules/deprecated-functions").DeprecatedFunctionsResult) => string;
|
|
20
|
+
};
|
|
21
|
+
readonly info: {
|
|
22
|
+
readonly name: "Deprecated Functions";
|
|
23
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Deprecated, import("./linter-tags").LintingRuleTag.Smell, import("./linter-tags").LintingRuleTag.Usability, import("./linter-tags").LintingRuleTag.Reproducibility];
|
|
24
|
+
readonly description: "Marks deprecated functions that should not be used anymore.";
|
|
25
|
+
readonly defaultConfig: {
|
|
26
|
+
readonly deprecatedFunctions: readonly ["all_equal", "arrange_all", "distinct_all", "filter_all", "group_by_all", "summarise_all", "mutate_all", "select_all", "vars", "all_vars", "id", "failwith", "select_vars", "rename_vars", "select_var", "current_vars", "bench_tbls", "compare_tbls", "compare_tbls2", "eval_tbls", "eval_tbls2", "location", "changes", "combine", "do", "funs", "add_count_", "add_tally_", "arrange_", "count_", "distinct_", "do_", "filter_", "funs_", "group_by_", "group_indices_", "mutate_", "tally_", "transmute_", "rename_", "rename_vars_", "select_", "select_vars_", "slice_", "summarise_", "summarize_", "summarise_each", "src_local", "tbl_df", "add_rownames", "group_nest", "group_split", "with_groups", "nest_by", "progress_estimated", "recode", "sample_n", "top_n", "transmute", "fct_explicit_na", "aes_", "aes_auto", "annotation_logticks", "is.Coord", "coord_flip", "coord_map", "is.facet", "fortify", "is.ggproto", "guide_train", "is.ggplot", "qplot", "is.theme", "gg_dep", "liply", "isplit2", "list_along", "cross", "invoke", "at_depth", "prepend", "rerun", "splice", "`%@%`", "rbernoulli", "rdunif", "when", "update_list", "map_raw", "accumulate", "reduce_right", "flatten", "map_dfr", "as_vector", "transpose", "melt_delim", "melt_fwf", "melt_table", "read_table2", "str_interp", "as_tibble", "data_frame", "tibble_", "data_frame_", "lst_", "as_data_frame", "as.tibble", "frame_data", "trunc_mat", "is.tibble", "tidy_names", "set_tidy_names", "repair_names", "extract_numeric", "complete_", "drop_na_", "expand_", "crossing_", "nesting_", "extract_", "fill_", "gather_", "nest_", "separate_rows_", "separate_", "spread_", "unite_", "unnest_", "extract", "gather", "nest_legacy", "separate_rows", "separate", "spread"];
|
|
27
|
+
};
|
|
20
28
|
};
|
|
21
29
|
};
|
|
22
30
|
readonly 'file-path-validity': {
|
|
23
|
-
readonly createSearch: (config: import("./rules/
|
|
24
|
-
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElementFromQuery<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/
|
|
31
|
+
readonly createSearch: (config: import("./rules/file-path-validity").FilePathValidityConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"from-query", [], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElementFromQuery<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
32
|
+
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElementFromQuery<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>, config: import("./rules/file-path-validity").FilePathValidityConfig, data: {
|
|
33
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
34
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
35
|
+
config: import("../config").FlowrConfigOptions;
|
|
36
|
+
}) => {
|
|
37
|
+
results: import("./rules/file-path-validity").FilePathValidityResult[];
|
|
38
|
+
".meta": import("./rules/file-path-validity").FilePathValidityMetadata;
|
|
39
|
+
};
|
|
40
|
+
readonly info: {
|
|
41
|
+
readonly name: "File Path Validity";
|
|
42
|
+
readonly description: "Checks whether file paths used in read and write operations are valid and point to existing files.";
|
|
43
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Robustness, import("./linter-tags").LintingRuleTag.Reproducibility, import("./linter-tags").LintingRuleTag.Bug];
|
|
44
|
+
readonly defaultConfig: {
|
|
45
|
+
readonly additionalReadFunctions: readonly [];
|
|
46
|
+
readonly additionalWriteFunctions: readonly [];
|
|
47
|
+
readonly includeUnknown: false;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly prettyPrint: {
|
|
51
|
+
readonly query: (result: import("./rules/file-path-validity").FilePathValidityResult) => string;
|
|
52
|
+
readonly full: (result: import("./rules/file-path-validity").FilePathValidityResult) => string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly 'seeded-randomness': {
|
|
56
|
+
readonly createSearch: (config: import("./rules/seeded-randomness").SeededRandomnessConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["with", "filter", "with"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../search/search-executor/search-enrichers").EnrichedFlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>>;
|
|
57
|
+
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/seeded-randomness").SeededRandomnessConfig, { dataflow }: {
|
|
58
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
59
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
60
|
+
config: import("../config").FlowrConfigOptions;
|
|
61
|
+
}) => {
|
|
62
|
+
results: {
|
|
63
|
+
certainty: import("./linter-format").LintingCertainty.Definitely;
|
|
64
|
+
function: import("../dataflow/environments/identifier").Identifier;
|
|
65
|
+
range: import("../util/range").SourceRange;
|
|
66
|
+
}[];
|
|
67
|
+
'.meta': import("./rules/seeded-randomness").SeededRandomnessMeta;
|
|
68
|
+
};
|
|
69
|
+
readonly info: {
|
|
70
|
+
readonly defaultConfig: {
|
|
71
|
+
readonly randomnessProducers: readonly [{
|
|
72
|
+
readonly type: "function";
|
|
73
|
+
readonly name: "set.seed";
|
|
74
|
+
}, {
|
|
75
|
+
readonly type: "assignment";
|
|
76
|
+
readonly name: ".Random.seed";
|
|
77
|
+
}];
|
|
78
|
+
readonly randomnessConsumers: readonly ["jitter", "sample", "sample.int", "arima.sim", "kmeans", "princomp", "rcauchy", "rchisq", "rexp", "rgamma", "rgeom", "rlnorm", "rlogis", "rmultinom", "rnbinom", "rnorm", "rpois", "runif", "pointLabel", "some", "rbernoulli", "rdunif", "generateSeedVectors"];
|
|
79
|
+
};
|
|
80
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Robustness, import("./linter-tags").LintingRuleTag.Reproducibility];
|
|
81
|
+
readonly name: "Seeded Randomness";
|
|
82
|
+
readonly description: "Checks whether randomness-based function calls are preceded by a random seed generation function. For consistent reproducibility, functions that use randomness should only be called after a constant random seed is set using a function like `set.seed`.";
|
|
83
|
+
};
|
|
84
|
+
readonly prettyPrint: {
|
|
85
|
+
readonly query: (result: import("./rules/seeded-randomness").SeededRandomnessResult, _meta: import("./rules/seeded-randomness").SeededRandomnessMeta) => string;
|
|
86
|
+
readonly full: (result: import("./rules/seeded-randomness").SeededRandomnessResult, _meta: import("./rules/seeded-randomness").SeededRandomnessMeta) => string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly 'absolute-file-paths': {
|
|
90
|
+
readonly createSearch: (config: import("./rules/absolute-path").AbsoluteFilePathConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["unique"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, 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>[]>>;
|
|
91
|
+
readonly processSearchResult: (elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, {
|
|
92
|
+
readonly query?: "config" | "origin" | "dataflow" | "search" | "call-context" | "control-flow" | "dataflow-lens" | "normalized-ast" | "id-map" | "dataflow-cluster" | "static-slice" | "lineage" | "dependencies" | "location-map" | "happens-before" | "resolve-value" | "project" | "linter" | undefined;
|
|
93
|
+
readonly queryResult?: import("../queries/base-query-format").BaseQueryResult | undefined;
|
|
94
|
+
readonly node: import("../r-bridge/lang-4.x/ast/model/nodes/r-expression-list").RExpressionList<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-function-definition").RFunctionDefinition<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RNamedFunctionCall<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RUnnamedFunctionCall<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-parameter").RParameter<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-argument").RArgument<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-comment").RComment<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-line-directive").RLineDirective<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-for-loop").RForLoop<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop").RRepeatLoop<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-while-loop").RWhileLoop<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else").RIfThenElse<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-access").RNamedAccess<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-access").RIndexAccess<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-unary-op").RUnaryOp<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-binary-op").RBinaryOp<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-symbol").RSymbol<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, string> | import("../r-bridge/lang-4.x/ast/model/nodes/r-number").RNumber<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-string").RString<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-logical").RLogical<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-break").RBreak<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-next").RNext<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation> | import("../r-bridge/lang-4.x/ast/model/nodes/r-pipe").RPipe<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>;
|
|
95
|
+
}[]>, config: import("./rules/absolute-path").AbsoluteFilePathConfig, data: {
|
|
25
96
|
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
26
97
|
dataflow: import("../dataflow/info").DataflowInformation;
|
|
98
|
+
config: import("../config").FlowrConfigOptions;
|
|
27
99
|
}) => {
|
|
28
|
-
results: import("./rules/
|
|
29
|
-
".meta": import("./rules/
|
|
30
|
-
};
|
|
31
|
-
readonly prettyPrint:
|
|
32
|
-
|
|
33
|
-
readonly
|
|
34
|
-
|
|
35
|
-
|
|
100
|
+
results: import("./rules/absolute-path").AbsoluteFilePathResult[];
|
|
101
|
+
".meta": import("./rules/absolute-path").AbsoluteFilePathMetadata;
|
|
102
|
+
};
|
|
103
|
+
readonly prettyPrint: {
|
|
104
|
+
readonly query: (result: import("./rules/absolute-path").AbsoluteFilePathResult) => string;
|
|
105
|
+
readonly full: (result: import("./rules/absolute-path").AbsoluteFilePathResult) => string;
|
|
106
|
+
};
|
|
107
|
+
readonly info: {
|
|
108
|
+
readonly name: "Absolute Paths";
|
|
109
|
+
readonly description: "Checks whether file paths are absolute.";
|
|
110
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Robustness, import("./linter-tags").LintingRuleTag.Reproducibility, import("./linter-tags").LintingRuleTag.Smell, import("./linter-tags").LintingRuleTag.QuickFix];
|
|
111
|
+
readonly defaultConfig: {
|
|
112
|
+
readonly include: {
|
|
113
|
+
readonly constructed: true;
|
|
114
|
+
readonly allStrings: false;
|
|
115
|
+
};
|
|
116
|
+
readonly additionalPathFunctions: readonly [];
|
|
117
|
+
readonly absolutePathRegex: undefined;
|
|
118
|
+
readonly useAsWd: "@script";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly 'unused-definitions': {
|
|
123
|
+
readonly createSearch: (config: import("./rules/unused-definition").UnusedDefinitionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, 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>[]>>;
|
|
124
|
+
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/unused-definition").UnusedDefinitionConfig, data: {
|
|
125
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
126
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
127
|
+
config: import("../config").FlowrConfigOptions;
|
|
128
|
+
}) => {
|
|
129
|
+
results: import("./rules/unused-definition").UnusedDefinitionResult[];
|
|
130
|
+
".meta": import("./rules/unused-definition").UnusedDefinitionMetadata;
|
|
131
|
+
};
|
|
132
|
+
readonly prettyPrint: {
|
|
133
|
+
readonly query: (result: import("./rules/unused-definition").UnusedDefinitionResult) => string;
|
|
134
|
+
readonly full: (result: import("./rules/unused-definition").UnusedDefinitionResult) => string;
|
|
135
|
+
};
|
|
136
|
+
readonly info: {
|
|
137
|
+
readonly name: "Unused Definitions";
|
|
138
|
+
readonly description: "Checks for unused definitions.";
|
|
139
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Readability, import("./linter-tags").LintingRuleTag.Smell, import("./linter-tags").LintingRuleTag.QuickFix];
|
|
140
|
+
readonly defaultConfig: {
|
|
141
|
+
readonly includeFunctionDefinitions: true;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly 'naming-convention': {
|
|
146
|
+
readonly createSearch: (_config: import("./rules/naming-convention").NamingConventionConfig) => import("../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, 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>[]>>;
|
|
147
|
+
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/naming-convention").NamingConventionConfig, data: {
|
|
148
|
+
normalize: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
149
|
+
dataflow: import("../dataflow/info").DataflowInformation;
|
|
150
|
+
config: import("../config").FlowrConfigOptions;
|
|
151
|
+
}) => {
|
|
152
|
+
results: {
|
|
153
|
+
quickFix: import("./linter-format").LintQuickFixReplacement[] | undefined;
|
|
154
|
+
certainty: import("./linter-format").LintingCertainty;
|
|
155
|
+
detectedCasing: import("./rules/naming-convention").CasingConvention;
|
|
156
|
+
name: string;
|
|
157
|
+
range: import("../util/range").SourceRange;
|
|
158
|
+
}[];
|
|
159
|
+
'.meta': {
|
|
160
|
+
numMatches: number;
|
|
161
|
+
numBreak: number;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly prettyPrint: {
|
|
165
|
+
readonly query: (result: import("./rules/naming-convention").NamingConventionResult) => string;
|
|
166
|
+
readonly full: (result: import("./rules/naming-convention").NamingConventionResult) => string;
|
|
167
|
+
};
|
|
168
|
+
readonly info: {
|
|
169
|
+
readonly name: "Naming Convention";
|
|
170
|
+
readonly description: "Checks wether the symbols conform to a certain naming convention";
|
|
171
|
+
readonly tags: readonly [import("./linter-tags").LintingRuleTag.Style, import("./linter-tags").LintingRuleTag.QuickFix];
|
|
172
|
+
readonly defaultConfig: {
|
|
173
|
+
readonly caseing: import("./rules/naming-convention").CasingConvention.PascalCase;
|
|
174
|
+
};
|
|
36
175
|
};
|
|
37
176
|
};
|
|
38
177
|
};
|
package/linter/linter-rules.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LintingRules = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const deprecated_functions_1 = require("./rules/deprecated-functions");
|
|
5
|
+
const file_path_validity_1 = require("./rules/file-path-validity");
|
|
6
|
+
const absolute_path_1 = require("./rules/absolute-path");
|
|
7
|
+
const unused_definition_1 = require("./rules/unused-definition");
|
|
8
|
+
const seeded_randomness_1 = require("./rules/seeded-randomness");
|
|
9
|
+
const naming_convention_1 = require("./rules/naming-convention");
|
|
6
10
|
/**
|
|
7
11
|
* The registry of currently supported linting rules.
|
|
8
12
|
* A linting rule can be executed on a dataflow pipeline result using {@link executeLintingRule}.
|
|
9
13
|
*/
|
|
10
14
|
exports.LintingRules = {
|
|
11
|
-
'deprecated-functions':
|
|
12
|
-
'file-path-validity':
|
|
15
|
+
'deprecated-functions': deprecated_functions_1.DEPRECATED_FUNCTIONS,
|
|
16
|
+
'file-path-validity': file_path_validity_1.FILE_PATH_VALIDITY,
|
|
17
|
+
'seeded-randomness': seeded_randomness_1.SEEDED_RANDOMNESS,
|
|
18
|
+
'absolute-file-paths': absolute_path_1.ABSOLUTE_PATH,
|
|
19
|
+
'unused-definitions': unused_definition_1.UNUSED_DEFINITION,
|
|
20
|
+
'naming-convention': naming_convention_1.NAMING_CONVENTION
|
|
13
21
|
};
|
|
14
22
|
//# sourceMappingURL=linter-rules.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specify the tags for the linter rules.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum LintingRuleTag {
|
|
5
|
+
/**
|
|
6
|
+
* This rule is used to detect bugs in the code.
|
|
7
|
+
* Everything that affects the semantics of the code, such as incorrect function calls, wrong arguments, etc.
|
|
8
|
+
* is to be considered a bug. Otherwise, it may be a smell or a style issue.
|
|
9
|
+
*/
|
|
10
|
+
Bug = "bug",
|
|
11
|
+
/**
|
|
12
|
+
* This signals the use of deprecated functions or features.
|
|
13
|
+
*/
|
|
14
|
+
Deprecated = "deprecated",
|
|
15
|
+
/**
|
|
16
|
+
* This rule is used to detect issues that are related to the documentation of the code.
|
|
17
|
+
* For example, missing or misleading comments.
|
|
18
|
+
*/
|
|
19
|
+
Documentation = "documentation",
|
|
20
|
+
/**
|
|
21
|
+
* This marks rules which are currently considered experimental, _not_ that they detect experimental code.
|
|
22
|
+
*/
|
|
23
|
+
Experimental = "experimental",
|
|
24
|
+
/**
|
|
25
|
+
* This rule is used to detect issues that are related to the performance of the code.
|
|
26
|
+
* For example, inefficient algorithms, unnecessary computations, or unoptimized data structures.
|
|
27
|
+
*/
|
|
28
|
+
Performance = "performance",
|
|
29
|
+
/**
|
|
30
|
+
* This rule is used to detect issues that are related to the portability of the code.
|
|
31
|
+
* For example, platform-specific code, or code that relies on specific R versions or packages.
|
|
32
|
+
*/
|
|
33
|
+
Robustness = "robustness",
|
|
34
|
+
/**
|
|
35
|
+
* The rule is specific to R version 3.x.
|
|
36
|
+
*/
|
|
37
|
+
Rver3 = "rver3",
|
|
38
|
+
/**
|
|
39
|
+
* The rule is specific to R version 4.x.
|
|
40
|
+
*/
|
|
41
|
+
Rver4 = "rver4",
|
|
42
|
+
/**
|
|
43
|
+
* This rule is used to detect issues that are related to the readability of the code.
|
|
44
|
+
* For example, complex expressions, long lines, or inconsistent formatting.
|
|
45
|
+
*/
|
|
46
|
+
Readability = "readability",
|
|
47
|
+
/**
|
|
48
|
+
* This rule is used to detect issues that are related to the reproducibility of the code.
|
|
49
|
+
* For example, missing or incorrect random seeds, or missing data.
|
|
50
|
+
*/
|
|
51
|
+
Reproducibility = "reproducibility",
|
|
52
|
+
/**
|
|
53
|
+
* This rule is used to detect security-critical.
|
|
54
|
+
* For example, missing input validation.
|
|
55
|
+
*/
|
|
56
|
+
Security = "security",
|
|
57
|
+
/**
|
|
58
|
+
* This rule is used to detect issues that are related to the shiny framework.
|
|
59
|
+
*/
|
|
60
|
+
Shiny = "shiny",
|
|
61
|
+
/**
|
|
62
|
+
* This rule is used to detect issues that do not directly affect the semantics of the code,
|
|
63
|
+
* but are still considered bad practice.
|
|
64
|
+
*/
|
|
65
|
+
Smell = "smell",
|
|
66
|
+
/**
|
|
67
|
+
* This rule is used to detect issues that are related to the style of the code.
|
|
68
|
+
* For example, inconsistent naming conventions, or missing or incorrect formatting.
|
|
69
|
+
*/
|
|
70
|
+
Style = "style",
|
|
71
|
+
/**
|
|
72
|
+
* This rule is used to detect issues that are related to the (re-)usability of the code.
|
|
73
|
+
* For example, missing or incorrect error handling, or missing or incorrect user interface elements.
|
|
74
|
+
*/
|
|
75
|
+
Usability = "usability",
|
|
76
|
+
/**
|
|
77
|
+
* This rule may provide quickfixes to automatically fix the issues it detects.
|
|
78
|
+
*/
|
|
79
|
+
QuickFix = "quickfix"
|
|
80
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LintingRuleTag = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Specify the tags for the linter rules.
|
|
6
|
+
*/
|
|
7
|
+
var LintingRuleTag;
|
|
8
|
+
(function (LintingRuleTag) {
|
|
9
|
+
/**
|
|
10
|
+
* This rule is used to detect bugs in the code.
|
|
11
|
+
* Everything that affects the semantics of the code, such as incorrect function calls, wrong arguments, etc.
|
|
12
|
+
* is to be considered a bug. Otherwise, it may be a smell or a style issue.
|
|
13
|
+
*/
|
|
14
|
+
LintingRuleTag["Bug"] = "bug";
|
|
15
|
+
/**
|
|
16
|
+
* This signals the use of deprecated functions or features.
|
|
17
|
+
*/
|
|
18
|
+
LintingRuleTag["Deprecated"] = "deprecated";
|
|
19
|
+
/**
|
|
20
|
+
* This rule is used to detect issues that are related to the documentation of the code.
|
|
21
|
+
* For example, missing or misleading comments.
|
|
22
|
+
*/
|
|
23
|
+
LintingRuleTag["Documentation"] = "documentation";
|
|
24
|
+
/**
|
|
25
|
+
* This marks rules which are currently considered experimental, _not_ that they detect experimental code.
|
|
26
|
+
*/
|
|
27
|
+
LintingRuleTag["Experimental"] = "experimental";
|
|
28
|
+
/**
|
|
29
|
+
* This rule is used to detect issues that are related to the performance of the code.
|
|
30
|
+
* For example, inefficient algorithms, unnecessary computations, or unoptimized data structures.
|
|
31
|
+
*/
|
|
32
|
+
LintingRuleTag["Performance"] = "performance";
|
|
33
|
+
/**
|
|
34
|
+
* This rule is used to detect issues that are related to the portability of the code.
|
|
35
|
+
* For example, platform-specific code, or code that relies on specific R versions or packages.
|
|
36
|
+
*/
|
|
37
|
+
LintingRuleTag["Robustness"] = "robustness";
|
|
38
|
+
/**
|
|
39
|
+
* The rule is specific to R version 3.x.
|
|
40
|
+
*/
|
|
41
|
+
LintingRuleTag["Rver3"] = "rver3";
|
|
42
|
+
/**
|
|
43
|
+
* The rule is specific to R version 4.x.
|
|
44
|
+
*/
|
|
45
|
+
LintingRuleTag["Rver4"] = "rver4";
|
|
46
|
+
/**
|
|
47
|
+
* This rule is used to detect issues that are related to the readability of the code.
|
|
48
|
+
* For example, complex expressions, long lines, or inconsistent formatting.
|
|
49
|
+
*/
|
|
50
|
+
LintingRuleTag["Readability"] = "readability";
|
|
51
|
+
/**
|
|
52
|
+
* This rule is used to detect issues that are related to the reproducibility of the code.
|
|
53
|
+
* For example, missing or incorrect random seeds, or missing data.
|
|
54
|
+
*/
|
|
55
|
+
LintingRuleTag["Reproducibility"] = "reproducibility";
|
|
56
|
+
/**
|
|
57
|
+
* This rule is used to detect security-critical.
|
|
58
|
+
* For example, missing input validation.
|
|
59
|
+
*/
|
|
60
|
+
LintingRuleTag["Security"] = "security";
|
|
61
|
+
/**
|
|
62
|
+
* This rule is used to detect issues that are related to the shiny framework.
|
|
63
|
+
*/
|
|
64
|
+
LintingRuleTag["Shiny"] = "shiny";
|
|
65
|
+
/**
|
|
66
|
+
* This rule is used to detect issues that do not directly affect the semantics of the code,
|
|
67
|
+
* but are still considered bad practice.
|
|
68
|
+
*/
|
|
69
|
+
LintingRuleTag["Smell"] = "smell";
|
|
70
|
+
/**
|
|
71
|
+
* This rule is used to detect issues that are related to the style of the code.
|
|
72
|
+
* For example, inconsistent naming conventions, or missing or incorrect formatting.
|
|
73
|
+
*/
|
|
74
|
+
LintingRuleTag["Style"] = "style";
|
|
75
|
+
/**
|
|
76
|
+
* This rule is used to detect issues that are related to the (re-)usability of the code.
|
|
77
|
+
* For example, missing or incorrect error handling, or missing or incorrect user interface elements.
|
|
78
|
+
*/
|
|
79
|
+
LintingRuleTag["Usability"] = "usability";
|
|
80
|
+
/**
|
|
81
|
+
* This rule may provide quickfixes to automatically fix the issues it detects.
|
|
82
|
+
*/
|
|
83
|
+
LintingRuleTag["QuickFix"] = "quickfix";
|
|
84
|
+
})(LintingRuleTag || (exports.LintingRuleTag = LintingRuleTag = {}));
|
|
85
|
+
//# sourceMappingURL=linter-tags.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { LintingResult } from '../linter-format';
|
|
2
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
3
|
+
import type { SourceRange } from '../../util/range';
|
|
4
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
5
|
+
import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
|
|
6
|
+
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
7
|
+
import type { FlowrConfigOptions } from '../../config';
|
|
8
|
+
export interface AbsoluteFilePathResult extends LintingResult {
|
|
9
|
+
filePath: string;
|
|
10
|
+
range: SourceRange;
|
|
11
|
+
}
|
|
12
|
+
type SupportedWd = '@script' | '@home' | string;
|
|
13
|
+
export interface AbsoluteFilePathConfig extends MergeableRecord {
|
|
14
|
+
/** Include paths that are built by functions, e.g., `file.path()` */
|
|
15
|
+
include: {
|
|
16
|
+
/** Whether to include paths that are constructed by functions */
|
|
17
|
+
constructed: boolean;
|
|
18
|
+
/** Include every string, even if it is not used as a file path, to count, strings must have a length of at least 3 chars */
|
|
19
|
+
allStrings: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Extend the built-in absolute path recognition with additional regexes */
|
|
22
|
+
absolutePathRegex: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The set of functions that should additionally be considered as using a file path.
|
|
25
|
+
* Entries in this array use the {@link FunctionInfo} format from the dependencies query.
|
|
26
|
+
*/
|
|
27
|
+
additionalPathFunctions: FunctionInfo[];
|
|
28
|
+
/**
|
|
29
|
+
* Which path should be considered to be the origin for relative paths.
|
|
30
|
+
* This is only relevant with quickfixes. In the future we may be sensitive to setwd etc.
|
|
31
|
+
*/
|
|
32
|
+
useAsWd: SupportedWd;
|
|
33
|
+
}
|
|
34
|
+
export interface AbsoluteFilePathMetadata extends MergeableRecord {
|
|
35
|
+
totalConsidered: number;
|
|
36
|
+
totalUnknown: number;
|
|
37
|
+
}
|
|
38
|
+
export declare const ABSOLUTE_PATH: {
|
|
39
|
+
readonly createSearch: (config: AbsoluteFilePathConfig) => import("../../search/flowr-search-builder").FlowrSearchBuilder<"from-query", ["unique"], ParentInformation, import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>;
|
|
40
|
+
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, {
|
|
41
|
+
readonly query?: "config" | "origin" | "dataflow" | "search" | "call-context" | "control-flow" | "dataflow-lens" | "normalized-ast" | "id-map" | "dataflow-cluster" | "static-slice" | "lineage" | "dependencies" | "location-map" | "happens-before" | "resolve-value" | "project" | "linter" | undefined;
|
|
42
|
+
readonly queryResult?: import("../../queries/base-query-format").BaseQueryResult | undefined;
|
|
43
|
+
readonly node: import("../../r-bridge/lang-4.x/ast/model/nodes/r-expression-list").RExpressionList<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition").RFunctionDefinition<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RNamedFunctionCall<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call").RUnnamedFunctionCall<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-parameter").RParameter<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-argument").RArgument<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-comment").RComment<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-line-directive").RLineDirective<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-for-loop").RForLoop<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop").RRepeatLoop<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-while-loop").RWhileLoop<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else").RIfThenElse<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-access").RNamedAccess<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-access").RIndexAccess<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-unary-op").RUnaryOp<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op").RBinaryOp<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol").RSymbol<ParentInformation, string> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-number").RNumber<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-string").RString<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-logical").RLogical<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-break").RBreak<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-next").RNext<ParentInformation> | import("../../r-bridge/lang-4.x/ast/model/nodes/r-pipe").RPipe<ParentInformation>;
|
|
44
|
+
}[]>, config: AbsoluteFilePathConfig, data: {
|
|
45
|
+
normalize: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
46
|
+
dataflow: import("../../dataflow/info").DataflowInformation;
|
|
47
|
+
config: FlowrConfigOptions;
|
|
48
|
+
}) => {
|
|
49
|
+
results: AbsoluteFilePathResult[];
|
|
50
|
+
".meta": AbsoluteFilePathMetadata;
|
|
51
|
+
};
|
|
52
|
+
readonly prettyPrint: {
|
|
53
|
+
readonly query: (result: AbsoluteFilePathResult) => string;
|
|
54
|
+
readonly full: (result: AbsoluteFilePathResult) => string;
|
|
55
|
+
};
|
|
56
|
+
readonly info: {
|
|
57
|
+
readonly name: "Absolute Paths";
|
|
58
|
+
readonly description: "Checks whether file paths are absolute.";
|
|
59
|
+
readonly tags: readonly [LintingRuleTag.Robustness, LintingRuleTag.Reproducibility, LintingRuleTag.Smell, LintingRuleTag.QuickFix];
|
|
60
|
+
readonly defaultConfig: {
|
|
61
|
+
readonly include: {
|
|
62
|
+
readonly constructed: true;
|
|
63
|
+
readonly allStrings: false;
|
|
64
|
+
};
|
|
65
|
+
readonly additionalPathFunctions: readonly [];
|
|
66
|
+
readonly absolutePathRegex: undefined;
|
|
67
|
+
readonly useAsWd: "@script";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export {};
|