@eagleoutice/flowr 2.17.9 → 2.17.10
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/cli/repl/core.js +4 -0
- package/config.d.ts +10 -0
- package/config.js +8 -1
- package/control-flow/control-flow-graph.js +11 -1
- package/dataflow/environments/default-builtin-config/guards-primitive-lang.js +1 -1
- package/dataflow/environments/default-builtin-config/guards.js +6 -1
- package/dataflow/environments/default-builtin-config/index.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/network-access.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/network-access.js +2 -0
- package/dataflow/environments/environment.d.ts +2 -0
- package/dataflow/environments/environment.js +5 -0
- package/dataflow/environments/frame-memory.d.ts +9 -0
- package/dataflow/environments/frame-memory.js +37 -0
- package/dataflow/environments/group-generics.d.ts +2 -0
- package/dataflow/environments/group-generics.js +7 -0
- package/dataflow/environments/identifier.d.ts +2 -0
- package/dataflow/environments/identifier.js +16 -0
- package/dataflow/environments/pkg-name.d.ts +1 -0
- package/dataflow/environments/query-fn-props.d.ts +4 -0
- package/dataflow/environments/query-fn-props.js +21 -4
- package/dataflow/environments/resolve-by-name.js +5 -3
- package/dataflow/extractor.js +26 -4
- package/dataflow/fn/guards/call-contracts.js +8 -4
- package/dataflow/fn/guards/function-guards.d.ts +13 -4
- package/dataflow/fn/guards/function-guards.js +147 -52
- package/dataflow/fn/guards/guard-term.d.ts +6 -3
- package/dataflow/fn/guards/guard-term.js +12 -6
- package/dataflow/graph/graph.d.ts +2 -0
- package/dataflow/graph/graph.js +9 -5
- package/dataflow/internal/dispatch-linking.d.ts +6 -0
- package/dataflow/internal/dispatch-linking.js +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +32 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +52 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +28 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +75 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +20 -6
- package/dataflow/processor.d.ts +3 -0
- package/documentation/data/faq/faqs.js +4 -0
- package/documentation/wiki-analyzer.js +13 -2
- package/documentation/wiki-interface.js +1 -0
- package/documentation/wiki-linter.js +3 -0
- package/linter/linter-executor.js +4 -1
- package/linter/linter-format.d.ts +5 -5
- package/linter/linter-rules.d.ts +47 -13
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-file-paths.js +1 -1
- package/linter/rules/autoload-files.d.ts +33 -0
- package/linter/rules/autoload-files.js +94 -0
- package/linter/rules/cmd-check/description-metadata.d.ts +2 -2
- package/linter/rules/cmd-check/description-metadata.js +1 -1
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +2 -2
- package/linter/rules/cmd-check/documentation-mismatch.js +1 -1
- package/linter/rules/cmd-check/file-checks.d.ts +6 -11
- package/linter/rules/cmd-check/file-checks.js +8 -3
- package/linter/rules/cmd-check/package-data.d.ts +2 -2
- package/linter/rules/cmd-check/package-data.js +1 -1
- package/linter/rules/cmd-check/package-metafiles.js +1 -1
- package/linter/rules/cmd-check/package-structure.d.ts +2 -2
- package/linter/rules/cmd-check/package-structure.js +1 -1
- package/linter/rules/cmd-check/rd-files.js +1 -1
- package/linter/rules/naming-convention.d.ts +9 -2
- package/linter/rules/process-state-in-session.js +4 -1
- package/linter/rules/software-has-license.d.ts +2 -2
- package/linter/rules/software-has-license.js +1 -2
- package/linter/rules/stop-call.d.ts +8 -3
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-cache.d.ts +3 -0
- package/project/cache/flowr-analyzer-cache.js +9 -0
- package/project/context/flowr-analyzer-context.d.ts +4 -3
- package/project/context/flowr-analyzer-context.js +18 -6
- package/project/context/flowr-analyzer-dependencies-context.d.ts +9 -0
- package/project/context/flowr-analyzer-dependencies-context.js +35 -6
- package/project/context/flowr-analyzer-environment-context.d.ts +1 -0
- package/project/context/flowr-analyzer-environment-context.js +1 -0
- package/project/context/flowr-analyzer-files-context.d.ts +4 -0
- package/project/context/flowr-analyzer-files-context.js +24 -0
- package/project/context/flowr-analyzer-functions-context.d.ts +1 -0
- package/project/context/flowr-analyzer-functions-context.js +6 -0
- package/project/context/flowr-analyzer-gas-context.d.ts +1 -0
- package/project/context/flowr-analyzer-gas-context.js +1 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +24 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.js +54 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +1 -0
- package/project/context/flowr-analyzer-loading-order-context.js +14 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +1 -0
- package/project/context/flowr-analyzer-meta-context.js +11 -0
- package/project/context/flowr-file.d.ts +2 -1
- package/project/context/flowr-file.js +5 -2
- package/project/flowr-analyzer.d.ts +22 -3
- package/project/flowr-analyzer.js +36 -0
- package/project/incremental/incremental-dataflow/incremental-dataflow.d.ts +142 -0
- package/project/incremental/incremental-dataflow/incremental-dataflow.js +330 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +22 -2
- package/project/plugins/flowr-analyzer-plugin.js +16 -1
- package/project/plugins/incremental/incremental-dataflow/flowr-analyzer-incremental-dataflow-heuristic-plugin.d.ts +52 -0
- package/project/plugins/incremental/incremental-dataflow/flowr-analyzer-incremental-dataflow-heuristic-plugin.js +50 -0
- package/project/plugins/incremental/incremental-dataflow/flowr-analyzer-incremental-dataflow-update-type-plugin.d.ts +77 -0
- package/project/plugins/incremental/incremental-dataflow/flowr-analyzer-incremental-dataflow-update-type-plugin.js +151 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +4 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +1 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -0
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +6 -1
- package/project/sigdb/decode.js +4 -1
- package/project/sigdb/dict.d.ts +7 -4
- package/project/sigdb/dict.js +20 -6
- package/project/sigdb/guarded-source.js +10 -0
- package/project/sigdb/reader.d.ts +8 -2
- package/project/sigdb/reader.js +44 -30
- package/queries/catalog/input-sources-query/simple-input-classifier.js +84 -10
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/objects.d.ts +14 -0
- package/util/objects.js +100 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FlowrSearchLike } from '../search/flowr-search-builder';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FlowrSearchElements } from '../search/flowr-search';
|
|
3
3
|
import type { MergeableRecord } from '../util/objects';
|
|
4
4
|
import type { GeneratorNames } from '../search/search-executor/search-generators';
|
|
5
5
|
import type { TransformerNames } from '../search/search-executor/search-transformer';
|
|
@@ -41,19 +41,19 @@ export interface LinterRuleInformation<Config extends MergeableRecord = never> {
|
|
|
41
41
|
* The base interface for a linting rule, which contains all of its relevant settings.
|
|
42
42
|
* The registry of valid linting rules is stored in {@link LintingRules}.
|
|
43
43
|
*/
|
|
44
|
-
export interface LintingRule<Result extends LintingResult, Metadata extends MergeableRecord = never, Config extends MergeableRecord = never, Info = ParentInformation, Elements extends
|
|
44
|
+
export interface LintingRule<Result extends LintingResult, Metadata extends MergeableRecord = never, Config extends MergeableRecord = never, Info = ParentInformation, Elements extends FlowrSearchElements<Info> | never = FlowrSearchElements<Info>> {
|
|
45
45
|
/**
|
|
46
46
|
* Creates a flowR search that will then be executed and whose results will be passed to {@link processSearchResult}.
|
|
47
47
|
* The analyzer the rule runs on is handed in as well, so a search built from flowR's built-ins can read the ones
|
|
48
48
|
* its {@link FlowrConfig} registered rather than the defaults.
|
|
49
49
|
* In the future, additional optimizations and transformations may be applied to the search between this function and {@link processSearchResult}.
|
|
50
50
|
*/
|
|
51
|
-
readonly createSearch: (config: Config, data: ReadonlyFlowrAnalysisProvider) => FlowrSearchLike<Info, GeneratorNames, TransformerNames[],
|
|
51
|
+
readonly createSearch: (config: Config, data: ReadonlyFlowrAnalysisProvider) => FlowrSearchLike<Info, GeneratorNames, TransformerNames[], Elements>;
|
|
52
52
|
/**
|
|
53
53
|
* Processes the search results of the search created through {@link createSearch}.
|
|
54
54
|
* This function is expected to return the linting results from this rule for the given search, ie usually the given script file.
|
|
55
55
|
*/
|
|
56
|
-
readonly processSearchResult: (elements:
|
|
56
|
+
readonly processSearchResult: (elements: Elements, config: Config, data: ReadonlyFlowrAnalysisProvider) => AsyncOrSync<{
|
|
57
57
|
results: Result[];
|
|
58
58
|
'.meta'?: Metadata;
|
|
59
59
|
}>;
|
|
@@ -110,7 +110,7 @@ export interface LintingResult {
|
|
|
110
110
|
/** The node ID or IDs involved in this linting result, if applicable. */
|
|
111
111
|
readonly involvedId: NodeId | NodeId[] | undefined;
|
|
112
112
|
/** The source location where this linting result occurs */
|
|
113
|
-
readonly loc: SourceLocation;
|
|
113
|
+
readonly loc: SourceLocation | undefined;
|
|
114
114
|
}
|
|
115
115
|
export interface ConfiguredLintingRule<Name extends LintingRuleNames = LintingRuleNames> {
|
|
116
116
|
readonly name: Name;
|
package/linter/linter-rules.d.ts
CHANGED
|
@@ -135,7 +135,14 @@ export declare const LintingRules: {
|
|
|
135
135
|
readonly 'naming-convention': {
|
|
136
136
|
readonly createSearch: () => 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>[]>>>;
|
|
137
137
|
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: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
138
|
-
results:
|
|
138
|
+
results: {
|
|
139
|
+
involvedId: import("..").NodeId;
|
|
140
|
+
quickFix: import("./linter-format").LintQuickFixReplacement[] | undefined;
|
|
141
|
+
certainty: import("./linter-format").LintingResultCertainty;
|
|
142
|
+
detectedCasing: import("./rules/naming-convention").CasingConvention;
|
|
143
|
+
name: string;
|
|
144
|
+
loc: readonly [startLine: import("../util/range").Line, startColumn: import("../util/range").Column, endLine: import("../util/range").Line, endColumn: import("../util/range").Column, f?: string | undefined] | undefined;
|
|
145
|
+
}[];
|
|
139
146
|
'.meta': {
|
|
140
147
|
numMatches: number;
|
|
141
148
|
numBreak: number;
|
|
@@ -219,7 +226,7 @@ export declare const LintingRules: {
|
|
|
219
226
|
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>[]>, useLessLoopConfig: import("./rules/useless-loop").UselessLoopConfig, data: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
220
227
|
results: {
|
|
221
228
|
name: string;
|
|
222
|
-
loc: import("..").SourceLocation;
|
|
229
|
+
loc: import("..").SourceLocation | undefined;
|
|
223
230
|
certainty: import("./linter-format").LintingResultCertainty;
|
|
224
231
|
involvedId: import("..").NodeId | import("..").NodeId[] | undefined;
|
|
225
232
|
}[];
|
|
@@ -264,7 +271,12 @@ export declare const LintingRules: {
|
|
|
264
271
|
readonly 'stop-call': {
|
|
265
272
|
readonly createSearch: () => 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>[]>>>;
|
|
266
273
|
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("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
267
|
-
results:
|
|
274
|
+
results: {
|
|
275
|
+
certainty: import("./linter-format").LintingResultCertainty;
|
|
276
|
+
involvedId: import("..").NodeId;
|
|
277
|
+
loc: readonly [startLine: import("../util/range").Line, startColumn: import("../util/range").Column, endLine: import("../util/range").Line, endColumn: import("../util/range").Column, f?: string | undefined] | undefined;
|
|
278
|
+
quickFix: import("./linter-format").LintQuickFixReplacement[] | undefined;
|
|
279
|
+
}[];
|
|
268
280
|
'.meta': import("./rules/stop-call").StopCallMetadata;
|
|
269
281
|
}>;
|
|
270
282
|
readonly prettyPrint: {
|
|
@@ -304,8 +316,8 @@ export declare const LintingRules: {
|
|
|
304
316
|
};
|
|
305
317
|
};
|
|
306
318
|
readonly 'software-has-license': {
|
|
307
|
-
readonly createSearch: () =>
|
|
308
|
-
readonly processSearchResult: (_elements:
|
|
319
|
+
readonly createSearch: () => never;
|
|
320
|
+
readonly processSearchResult: (_elements: never, config: import("./rules/software-has-license").SoftwareHasLicenseConfig, data: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => {
|
|
309
321
|
results: import("./rules/software-has-license").SoftwareHasLicenseResult[];
|
|
310
322
|
'.meta': {};
|
|
311
323
|
};
|
|
@@ -613,11 +625,11 @@ export declare const LintingRules: {
|
|
|
613
625
|
readonly prettyPrint: {
|
|
614
626
|
readonly query: (r: {
|
|
615
627
|
readonly message: string;
|
|
616
|
-
readonly loc: import("..").SourceLocation;
|
|
628
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
617
629
|
}, metadata: unknown) => string;
|
|
618
630
|
readonly full: (r: {
|
|
619
631
|
readonly message: string;
|
|
620
|
-
readonly loc: import("..").SourceLocation;
|
|
632
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
621
633
|
}, metadata: unknown) => string;
|
|
622
634
|
};
|
|
623
635
|
readonly info: {
|
|
@@ -644,11 +656,11 @@ export declare const LintingRules: {
|
|
|
644
656
|
readonly prettyPrint: {
|
|
645
657
|
readonly query: (r: {
|
|
646
658
|
readonly message: string;
|
|
647
|
-
readonly loc: import("..").SourceLocation;
|
|
659
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
648
660
|
}, metadata: unknown) => string;
|
|
649
661
|
readonly full: (r: {
|
|
650
662
|
readonly message: string;
|
|
651
|
-
readonly loc: import("..").SourceLocation;
|
|
663
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
652
664
|
}, metadata: unknown) => string;
|
|
653
665
|
};
|
|
654
666
|
readonly info: {
|
|
@@ -914,11 +926,11 @@ export declare const LintingRules: {
|
|
|
914
926
|
readonly prettyPrint: {
|
|
915
927
|
readonly query: (r: {
|
|
916
928
|
readonly message: string;
|
|
917
|
-
readonly loc: import("..").SourceLocation;
|
|
929
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
918
930
|
}, metadata: unknown) => string;
|
|
919
931
|
readonly full: (r: {
|
|
920
932
|
readonly message: string;
|
|
921
|
-
readonly loc: import("..").SourceLocation;
|
|
933
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
922
934
|
}, metadata: unknown) => string;
|
|
923
935
|
};
|
|
924
936
|
readonly info: {
|
|
@@ -1085,11 +1097,11 @@ export declare const LintingRules: {
|
|
|
1085
1097
|
readonly prettyPrint: {
|
|
1086
1098
|
readonly query: (r: {
|
|
1087
1099
|
readonly message: string;
|
|
1088
|
-
readonly loc: import("..").SourceLocation;
|
|
1100
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
1089
1101
|
}, metadata: unknown) => string;
|
|
1090
1102
|
readonly full: (r: {
|
|
1091
1103
|
readonly message: string;
|
|
1092
|
-
readonly loc: import("..").SourceLocation;
|
|
1104
|
+
readonly loc: import("..").SourceLocation | undefined;
|
|
1093
1105
|
}, metadata: unknown) => string;
|
|
1094
1106
|
};
|
|
1095
1107
|
readonly info: {
|
|
@@ -1261,6 +1273,28 @@ export declare const LintingRules: {
|
|
|
1261
1273
|
};
|
|
1262
1274
|
};
|
|
1263
1275
|
};
|
|
1276
|
+
readonly 'autoload-files': {
|
|
1277
|
+
readonly createSearch: () => never;
|
|
1278
|
+
readonly processSearchResult: (_elements: never, config: import("./rules/autoload-files").AutoloadFilesConfig, data: import("..").ReadonlyFlowrAnalysisProvider<import("..").KnownParser>) => Promise<{
|
|
1279
|
+
results: import("./rules/autoload-files").AutoloadFilesResult[];
|
|
1280
|
+
'.meta': import("../util/objects").MergeableRecord;
|
|
1281
|
+
}>;
|
|
1282
|
+
readonly prettyPrint: {
|
|
1283
|
+
readonly query: (result: import("./rules/autoload-files").AutoloadFilesResult) => string;
|
|
1284
|
+
readonly full: (result: import("./rules/autoload-files").AutoloadFilesResult) => string;
|
|
1285
|
+
};
|
|
1286
|
+
readonly info: {
|
|
1287
|
+
readonly name: "Autoload Files";
|
|
1288
|
+
readonly description: "Finds code in a project that will be executed automatically through autoload files like .RProfile";
|
|
1289
|
+
readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Smell];
|
|
1290
|
+
readonly certainty: import("./linter-format").LintingRuleCertainty.OverApproximative;
|
|
1291
|
+
readonly defaultConfig: () => {
|
|
1292
|
+
allowEmptyFiles: true;
|
|
1293
|
+
allowInvalidFiles: false;
|
|
1294
|
+
allowedFilePatterns: never[];
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1297
|
+
};
|
|
1264
1298
|
};
|
|
1265
1299
|
export type LintingRuleNames = keyof typeof LintingRules;
|
|
1266
1300
|
/**
|
package/linter/linter-rules.js
CHANGED
|
@@ -50,6 +50,7 @@ const secret_exfiltration_1 = require("./rules/secret-exfiltration");
|
|
|
50
50
|
const process_state_in_session_1 = require("./rules/process-state-in-session");
|
|
51
51
|
const interactive_functions_1 = require("./rules/interactive-functions");
|
|
52
52
|
const code_clones_1 = require("./rules/code-clones");
|
|
53
|
+
const autoload_files_1 = require("./rules/autoload-files");
|
|
53
54
|
const call_contracts_1 = require("./rules/call-contracts");
|
|
54
55
|
/**
|
|
55
56
|
* The registry of currently supported linting rules.
|
|
@@ -102,7 +103,8 @@ exports.LintingRules = {
|
|
|
102
103
|
'process-state-in-session': process_state_in_session_1.PROCESS_STATE_IN_SESSION,
|
|
103
104
|
'code-clones': code_clones_1.CODE_CLONES,
|
|
104
105
|
'call-contracts': call_contracts_1.CALL_CONTRACTS,
|
|
105
|
-
'interactive-functions': interactive_functions_1.INTERACTIVE_FUNCTIONS
|
|
106
|
+
'interactive-functions': interactive_functions_1.INTERACTIVE_FUNCTIONS,
|
|
107
|
+
'autoload-files': autoload_files_1.AUTOLOAD_FILES
|
|
106
108
|
};
|
|
107
109
|
const DigitWords = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'];
|
|
108
110
|
/**
|
|
@@ -82,7 +82,7 @@ function resolvePathForAbsoluteCheck(value, ignoreUrls) {
|
|
|
82
82
|
}
|
|
83
83
|
/** A path built within a call that already reports it, as `file.path` within `read.csv`, is one finding. */
|
|
84
84
|
function withoutNested(results) {
|
|
85
|
-
return results.filter((r, i) => !results.some((o, j) => i !== j && o.filePath === r.filePath
|
|
85
|
+
return results.filter((r, i) => !results.some((o, j) => i !== j && o.filePath === r.filePath && r.loc !== undefined && o.loc !== undefined
|
|
86
86
|
&& (range_1.SourceRange.isStrictSubsetOf(r.loc, o.loc) || (j < i && range_1.SourceRange.equals(r.loc, o.loc)))));
|
|
87
87
|
}
|
|
88
88
|
exports.ABSOLUTE_FILE_PATHS = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
2
|
+
import { LintingRuleTag } from '../linter-tags';
|
|
3
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
4
|
+
export interface AutoloadFilesResult extends LintingResult {
|
|
5
|
+
readonly filePath: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AutoloadFilesConfig extends MergeableRecord {
|
|
8
|
+
readonly allowEmptyFiles: boolean;
|
|
9
|
+
readonly allowInvalidFiles: boolean;
|
|
10
|
+
readonly allowedFilePatterns: (string | RegExp)[];
|
|
11
|
+
}
|
|
12
|
+
export declare const AUTOLOAD_FILES: {
|
|
13
|
+
readonly createSearch: () => never;
|
|
14
|
+
readonly processSearchResult: (_elements: never, config: AutoloadFilesConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
15
|
+
results: AutoloadFilesResult[];
|
|
16
|
+
'.meta': MergeableRecord;
|
|
17
|
+
}>;
|
|
18
|
+
readonly prettyPrint: {
|
|
19
|
+
readonly query: (result: AutoloadFilesResult) => string;
|
|
20
|
+
readonly full: (result: AutoloadFilesResult) => string;
|
|
21
|
+
};
|
|
22
|
+
readonly info: {
|
|
23
|
+
readonly name: "Autoload Files";
|
|
24
|
+
readonly description: "Finds code in a project that will be executed automatically through autoload files like .RProfile";
|
|
25
|
+
readonly tags: readonly [LintingRuleTag.Security, LintingRuleTag.Smell];
|
|
26
|
+
readonly certainty: LintingRuleCertainty.OverApproximative;
|
|
27
|
+
readonly defaultConfig: () => {
|
|
28
|
+
allowEmptyFiles: true;
|
|
29
|
+
allowInvalidFiles: false;
|
|
30
|
+
allowedFilePatterns: never[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTOLOAD_FILES = void 0;
|
|
4
|
+
const linter_format_1 = require("../linter-format");
|
|
5
|
+
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
6
|
+
const linter_tags_1 = require("../linter-tags");
|
|
7
|
+
const flowr_analyzer_builder_1 = require("../../project/flowr-analyzer-builder");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
exports.AUTOLOAD_FILES = {
|
|
10
|
+
createSearch: () => undefined,
|
|
11
|
+
processSearchResult: async (_elements, config, data) => {
|
|
12
|
+
const ctx = data.inspectContext();
|
|
13
|
+
const patterns = config.allowedFilePatterns.map(p => typeof p === 'string' ? new RegExp(p) : p);
|
|
14
|
+
let startupFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.Startup).filter(f => !patterns.some(p => p.exec(f.path())));
|
|
15
|
+
if (config.allowEmptyFiles) {
|
|
16
|
+
// when allowing empty files, just ignore them in our search
|
|
17
|
+
startupFiles = startupFiles.filter(f => f.content().toString().trim().length > 0);
|
|
18
|
+
}
|
|
19
|
+
const foundPaths = new Set(); // for deduplicating results
|
|
20
|
+
const ret = { results: [], '.meta': {} };
|
|
21
|
+
if (startupFiles.length <= 0) {
|
|
22
|
+
return ret;
|
|
23
|
+
}
|
|
24
|
+
// "top-level" startup files
|
|
25
|
+
for (const file of startupFiles) {
|
|
26
|
+
const path = file.path();
|
|
27
|
+
if (!foundPaths.has(path)) {
|
|
28
|
+
foundPaths.add(path);
|
|
29
|
+
ret.results.push({
|
|
30
|
+
certainty: linter_format_1.LintingResultCertainty.Certain,
|
|
31
|
+
filePath: path,
|
|
32
|
+
involvedId: undefined,
|
|
33
|
+
loc: undefined
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// use dependency query to find files that are sourced by our top-level startup files (and recursively)
|
|
38
|
+
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setConfig(ctx.config).build();
|
|
39
|
+
try {
|
|
40
|
+
/* the files of the main analyzer, as copies where possible, since a file shared with this short-lived analyzer would notify it of every later change */
|
|
41
|
+
for (const file of ctx.files.getAllFiles()) {
|
|
42
|
+
analyzer.addFile(file instanceof flowr_file_1.FlowrInlineTextFile ? file.copy() : file instanceof flowr_file_1.FlowrTextFile ? file.path() : file);
|
|
43
|
+
}
|
|
44
|
+
for (const file of startupFiles) {
|
|
45
|
+
analyzer.addRequest({ request: 'file', content: file.path() });
|
|
46
|
+
}
|
|
47
|
+
const deps = await analyzer.query([{ type: 'dependencies', enabledCategories: ['source'] }]);
|
|
48
|
+
const idMap = (await analyzer.dataflow()).graph.idMap;
|
|
49
|
+
if (idMap === undefined) {
|
|
50
|
+
return ret;
|
|
51
|
+
}
|
|
52
|
+
for (const sourced of deps.dependencies.source) {
|
|
53
|
+
if (sourced.value === undefined || sourced.nodeId === undefined) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const node = idMap.get(sourced.nodeId);
|
|
57
|
+
if (node === undefined) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const path = (0, path_1.isAbsolute)(sourced.value) || node.info.file === undefined ? (0, path_1.normalize)(sourced.value) : (0, path_1.join)((0, path_1.dirname)(node.info.file), sourced.value);
|
|
61
|
+
const certainty = analyzer.inspectContext().files.hasFile(path) ? linter_format_1.LintingResultCertainty.Certain : !config.allowInvalidFiles ? linter_format_1.LintingResultCertainty.Uncertain : undefined;
|
|
62
|
+
if (certainty !== undefined && !foundPaths.has(path)) {
|
|
63
|
+
foundPaths.add(path);
|
|
64
|
+
ret.results.push({
|
|
65
|
+
certainty,
|
|
66
|
+
filePath: path,
|
|
67
|
+
involvedId: undefined,
|
|
68
|
+
loc: undefined
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
analyzer.close();
|
|
75
|
+
}
|
|
76
|
+
return ret;
|
|
77
|
+
},
|
|
78
|
+
prettyPrint: {
|
|
79
|
+
[linter_format_1.LintingPrettyPrintContext.Query]: (result) => `File \`${result.filePath}\``,
|
|
80
|
+
[linter_format_1.LintingPrettyPrintContext.Full]: (result) => `File \`${result.filePath}\` will be executed automatically when running scripts in this project; ensure that it contains no malicious code.`
|
|
81
|
+
},
|
|
82
|
+
info: {
|
|
83
|
+
name: 'Autoload Files',
|
|
84
|
+
description: 'Finds code in a project that will be executed automatically through autoload files like .RProfile',
|
|
85
|
+
tags: [linter_tags_1.LintingRuleTag.Security, linter_tags_1.LintingRuleTag.Smell],
|
|
86
|
+
certainty: linter_format_1.LintingRuleCertainty.OverApproximative,
|
|
87
|
+
defaultConfig: () => ({
|
|
88
|
+
allowEmptyFiles: true,
|
|
89
|
+
allowInvalidFiles: false,
|
|
90
|
+
allowedFilePatterns: []
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=autoload-files.js.map
|
|
@@ -42,11 +42,11 @@ export declare const DESCRIPTION_METADATA: {
|
|
|
42
42
|
readonly prettyPrint: {
|
|
43
43
|
readonly query: (r: {
|
|
44
44
|
readonly message: string;
|
|
45
|
-
readonly loc: SourceLocation;
|
|
45
|
+
readonly loc: SourceLocation | undefined;
|
|
46
46
|
}, metadata: unknown) => string;
|
|
47
47
|
readonly full: (r: {
|
|
48
48
|
readonly message: string;
|
|
49
|
-
readonly loc: SourceLocation;
|
|
49
|
+
readonly loc: SourceLocation | undefined;
|
|
50
50
|
}, metadata: unknown) => string;
|
|
51
51
|
};
|
|
52
52
|
readonly info: {
|
|
@@ -377,7 +377,7 @@ exports.DESCRIPTION_METADATA = {
|
|
|
377
377
|
}
|
|
378
378
|
return { results, '.meta': { hasDescription: true } };
|
|
379
379
|
},
|
|
380
|
-
prettyPrint: file_checks_1.
|
|
380
|
+
prettyPrint: (0, file_checks_1.prettyPrintMessageAtLocation)(),
|
|
381
381
|
info: {
|
|
382
382
|
name: 'Description Metadata',
|
|
383
383
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck],
|
|
@@ -44,11 +44,11 @@ export declare const DOCUMENTATION_MISMATCH: {
|
|
|
44
44
|
readonly prettyPrint: {
|
|
45
45
|
readonly query: (r: {
|
|
46
46
|
readonly message: string;
|
|
47
|
-
readonly loc: SourceLocation;
|
|
47
|
+
readonly loc: SourceLocation | undefined;
|
|
48
48
|
}, metadata: unknown) => string;
|
|
49
49
|
readonly full: (r: {
|
|
50
50
|
readonly message: string;
|
|
51
|
-
readonly loc: SourceLocation;
|
|
51
|
+
readonly loc: SourceLocation | undefined;
|
|
52
52
|
}, metadata: unknown) => string;
|
|
53
53
|
};
|
|
54
54
|
readonly info: {
|
|
@@ -238,7 +238,7 @@ exports.DOCUMENTATION_MISMATCH = {
|
|
|
238
238
|
}
|
|
239
239
|
return { results, '.meta': { consideredObjects, consideredPages: pages.length } };
|
|
240
240
|
},
|
|
241
|
-
prettyPrint: file_checks_1.
|
|
241
|
+
prettyPrint: (0, file_checks_1.prettyPrintMessageAtLocation)(),
|
|
242
242
|
info: {
|
|
243
243
|
name: 'Documentation Mismatch',
|
|
244
244
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck, linter_tags_1.LintingRuleTag.Documentation, linter_tags_1.LintingRuleTag.Bug],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LintingResultCertainty } from '../../linter-format';
|
|
1
|
+
import { type LintingPrettyPrintContext, LintingResultCertainty } from '../../linter-format';
|
|
2
2
|
import { SourceLocation, type Line } from '../../../util/range';
|
|
3
3
|
import { type CmdCheckResult, type PackageInfo } from './cmd-check-util';
|
|
4
4
|
import { type PackageFiles } from './package-files';
|
|
@@ -30,18 +30,13 @@ export declare function linesOf(pf: PackageFiles, file: string): string[];
|
|
|
30
30
|
/** The 1-based number of the first line of `file` matching `pattern`, `undefined` if none does. */
|
|
31
31
|
export declare function firstLine(pf: PackageFiles, file: string, pattern: RegExp): number | undefined;
|
|
32
32
|
/** Pretty printing of a file finding as its kind, file and location, in full as its message and location. */
|
|
33
|
-
export declare
|
|
34
|
-
readonly
|
|
35
|
-
readonly full: (r: FileResult<string>, metadata: unknown) => string;
|
|
33
|
+
export declare function prettyPrintKindInFile(): {
|
|
34
|
+
readonly [C in LintingPrettyPrintContext]: (r: FileResult<string>, metadata: unknown) => string;
|
|
36
35
|
};
|
|
37
36
|
/** Pretty printing of a finding as its message and location. */
|
|
38
|
-
export declare
|
|
39
|
-
readonly
|
|
37
|
+
export declare function prettyPrintMessageAtLocation(): {
|
|
38
|
+
readonly [C in LintingPrettyPrintContext]: (r: {
|
|
40
39
|
readonly message: string;
|
|
41
|
-
readonly loc: SourceLocation;
|
|
42
|
-
}, metadata: unknown) => string;
|
|
43
|
-
readonly full: (r: {
|
|
44
|
-
readonly message: string;
|
|
45
|
-
readonly loc: SourceLocation;
|
|
40
|
+
readonly loc: SourceLocation | undefined;
|
|
46
41
|
}, metadata: unknown) => string;
|
|
47
42
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageAtLocation = exports.KindInFile = void 0;
|
|
4
3
|
exports.fileFindings = fileFindings;
|
|
5
4
|
exports.onPackageFiles = onPackageFiles;
|
|
6
5
|
exports.linesOf = linesOf;
|
|
7
6
|
exports.firstLine = firstLine;
|
|
7
|
+
exports.prettyPrintKindInFile = prettyPrintKindInFile;
|
|
8
|
+
exports.prettyPrintMessageAtLocation = prettyPrintMessageAtLocation;
|
|
8
9
|
const linter_format_1 = require("../../linter-format");
|
|
9
10
|
const range_1 = require("../../../util/range");
|
|
10
11
|
const cmd_check_util_1 = require("./cmd-check-util");
|
|
@@ -38,7 +39,11 @@ function firstLine(pf, file, pattern) {
|
|
|
38
39
|
return i < 0 ? undefined : i + 1;
|
|
39
40
|
}
|
|
40
41
|
/** Pretty printing of a file finding as its kind, file and location, in full as its message and location. */
|
|
41
|
-
|
|
42
|
+
function prettyPrintKindInFile() {
|
|
43
|
+
return (0, linter_format_1.prettyPrint)(r => `${r.kind} in ${r.file} at ${range_1.SourceLocation.format(r.loc)}`, r => `${r.message} (at ${range_1.SourceLocation.format(r.loc)})`);
|
|
44
|
+
}
|
|
42
45
|
/** Pretty printing of a finding as its message and location. */
|
|
43
|
-
|
|
46
|
+
function prettyPrintMessageAtLocation() {
|
|
47
|
+
return (0, linter_format_1.prettyPrint)(r => `${r.message} at ${range_1.SourceLocation.format(r.loc)}`);
|
|
48
|
+
}
|
|
44
49
|
//# sourceMappingURL=file-checks.js.map
|
|
@@ -36,11 +36,11 @@ export declare const PACKAGE_DATA: {
|
|
|
36
36
|
readonly prettyPrint: {
|
|
37
37
|
readonly query: (r: {
|
|
38
38
|
readonly message: string;
|
|
39
|
-
readonly loc: import("../../..").SourceLocation;
|
|
39
|
+
readonly loc: import("../../..").SourceLocation | undefined;
|
|
40
40
|
}, metadata: unknown) => string;
|
|
41
41
|
readonly full: (r: {
|
|
42
42
|
readonly message: string;
|
|
43
|
-
readonly loc: import("../../..").SourceLocation;
|
|
43
|
+
readonly loc: import("../../..").SourceLocation | undefined;
|
|
44
44
|
}, metadata: unknown) => string;
|
|
45
45
|
};
|
|
46
46
|
readonly info: {
|
|
@@ -162,7 +162,7 @@ exports.PACKAGE_DATA = {
|
|
|
162
162
|
}
|
|
163
163
|
return { results, '.meta': { inspectedDataFiles: dataSets.length + entries.filter(e => e.relative === SysData).length, onDisk: pf.onDisk } };
|
|
164
164
|
}),
|
|
165
|
-
prettyPrint: file_checks_1.
|
|
165
|
+
prettyPrint: (0, file_checks_1.prettyPrintMessageAtLocation)(),
|
|
166
166
|
info: {
|
|
167
167
|
name: 'Package Data',
|
|
168
168
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck],
|
|
@@ -253,7 +253,7 @@ exports.PACKAGE_METAFILES = {
|
|
|
253
253
|
}
|
|
254
254
|
return { results, '.meta': { checkedFiles: checked } };
|
|
255
255
|
}),
|
|
256
|
-
prettyPrint: file_checks_1.
|
|
256
|
+
prettyPrint: (0, file_checks_1.prettyPrintKindInFile)(),
|
|
257
257
|
info: {
|
|
258
258
|
name: 'Package Metafiles',
|
|
259
259
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck, linter_tags_1.LintingRuleTag.Robustness],
|
|
@@ -59,11 +59,11 @@ export declare const PACKAGE_STRUCTURE: {
|
|
|
59
59
|
readonly prettyPrint: {
|
|
60
60
|
readonly query: (r: {
|
|
61
61
|
readonly message: string;
|
|
62
|
-
readonly loc: import("../../..").SourceLocation;
|
|
62
|
+
readonly loc: import("../../..").SourceLocation | undefined;
|
|
63
63
|
}, metadata: unknown) => string;
|
|
64
64
|
readonly full: (r: {
|
|
65
65
|
readonly message: string;
|
|
66
|
-
readonly loc: import("../../..").SourceLocation;
|
|
66
|
+
readonly loc: import("../../..").SourceLocation | undefined;
|
|
67
67
|
}, metadata: unknown) => string;
|
|
68
68
|
};
|
|
69
69
|
readonly info: {
|
|
@@ -285,7 +285,7 @@ exports.PACKAGE_STRUCTURE = {
|
|
|
285
285
|
buildFindings(env).forEach(([kind, message]) => found.add(kind, 'build/vignette.rds', message));
|
|
286
286
|
return { results: found.results, '.meta': { inspectedEntries: entries.length, onDisk: pf.onDisk } };
|
|
287
287
|
}),
|
|
288
|
-
prettyPrint: file_checks_1.
|
|
288
|
+
prettyPrint: (0, file_checks_1.prettyPrintMessageAtLocation)(),
|
|
289
289
|
info: {
|
|
290
290
|
name: 'Package Structure',
|
|
291
291
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck], certainty: linter_format_1.LintingRuleCertainty.BestEffort,
|
|
@@ -594,7 +594,7 @@ exports.RD_FILES = {
|
|
|
594
594
|
}
|
|
595
595
|
return { results, '.meta': { checkedFiles: pages.length } };
|
|
596
596
|
}),
|
|
597
|
-
prettyPrint: file_checks_1.
|
|
597
|
+
prettyPrint: (0, file_checks_1.prettyPrintKindInFile)(),
|
|
598
598
|
info: {
|
|
599
599
|
name: 'Rd Files',
|
|
600
600
|
tags: [linter_tags_1.LintingRuleTag.CmdCheck, linter_tags_1.LintingRuleTag.Robustness],
|
|
@@ -2,7 +2,7 @@ import type { BrandedIdentifier } from '../../dataflow/environments/identifier';
|
|
|
2
2
|
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import type { DataflowGraph } from '../../dataflow/graph/graph';
|
|
4
4
|
import type { MergeableRecord } from '../../util/objects';
|
|
5
|
-
import { type LintingResult, type LintQuickFixReplacement, LintingRuleCertainty } from '../linter-format';
|
|
5
|
+
import { type LintingResult, type LintQuickFixReplacement, LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
|
|
6
6
|
import { LintingRuleTag } from '../linter-tags';
|
|
7
7
|
export declare enum CasingConvention {
|
|
8
8
|
CamelCase = "camelCase",
|
|
@@ -50,7 +50,14 @@ export declare function createNamingConventionQuickFixes(graph: DataflowGraph, n
|
|
|
50
50
|
export declare const NAMING_CONVENTION: {
|
|
51
51
|
readonly createSearch: () => 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>[]>>>;
|
|
52
52
|
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: NamingConventionConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
53
|
-
results:
|
|
53
|
+
results: {
|
|
54
|
+
involvedId: NodeId;
|
|
55
|
+
quickFix: LintQuickFixReplacement[] | undefined;
|
|
56
|
+
certainty: LintingResultCertainty;
|
|
57
|
+
detectedCasing: CasingConvention;
|
|
58
|
+
name: string;
|
|
59
|
+
loc: readonly [startLine: import("../../util/range").Line, startColumn: import("../../util/range").Column, endLine: import("../../util/range").Line, endColumn: import("../../util/range").Column, f?: string | undefined] | undefined;
|
|
60
|
+
}[];
|
|
54
61
|
'.meta': {
|
|
55
62
|
numMatches: number;
|
|
56
63
|
numBreak: number;
|
|
@@ -239,7 +239,10 @@ exports.PROCESS_STATE_IN_SESSION = {
|
|
|
239
239
|
add(node, ProcessStateChange.CacheKey, write.name, write.fix.replace('%s', missing.join(', ')));
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
return {
|
|
242
|
+
return {
|
|
243
|
+
results: results.toSorted((a, b) => range_1.SourceLocation.compare(a.loc, b.loc)),
|
|
244
|
+
'.meta': { sessionFunctions: sessions.length }
|
|
245
|
+
};
|
|
243
246
|
},
|
|
244
247
|
prettyPrint: (0, linter_format_1.prettyPrint)(result => `${result.change} by ${result.name} at ${range_1.SourceLocation.format(result.loc)}`, result => `${result.name} changes the state all sessions share (${result.change}) at ${range_1.SourceLocation.format(result.loc)}; instead, use ${result.suggestion}`),
|
|
245
248
|
info: {
|
|
@@ -10,8 +10,8 @@ export interface SoftwareHasLicenseConfig extends MergeableRecord {
|
|
|
10
10
|
}
|
|
11
11
|
export type SoftwareHasLicenseMetadata = MergeableRecord;
|
|
12
12
|
export declare const SOFTWARE_HAS_LICENSE: {
|
|
13
|
-
readonly createSearch: () =>
|
|
14
|
-
readonly processSearchResult: (_elements:
|
|
13
|
+
readonly createSearch: () => never;
|
|
14
|
+
readonly processSearchResult: (_elements: never, config: SoftwareHasLicenseConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => {
|
|
15
15
|
results: SoftwareHasLicenseResult[];
|
|
16
16
|
'.meta': {};
|
|
17
17
|
};
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SOFTWARE_HAS_LICENSE = void 0;
|
|
4
4
|
const linter_format_1 = require("../linter-format");
|
|
5
|
-
const flowr_search_builder_1 = require("../../search/flowr-search-builder");
|
|
6
5
|
const range_1 = require("../../util/range");
|
|
7
6
|
const linter_tags_1 = require("../linter-tags");
|
|
8
7
|
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
9
8
|
const flowr_description_file_1 = require("../../project/plugins/file-plugins/files/flowr-description-file");
|
|
10
9
|
exports.SOFTWARE_HAS_LICENSE = {
|
|
11
|
-
createSearch: () =>
|
|
10
|
+
createSearch: () => undefined,
|
|
12
11
|
processSearchResult: (_elements, config, data) => {
|
|
13
12
|
const ctx = data.inspectContext();
|
|
14
13
|
const licenseFiles = ctx.files.getFilesByRole(flowr_file_1.FileRole.License);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type LintingResult, LintingRuleCertainty } from '../linter-format';
|
|
1
|
+
import { type LintingResult, LintingResultCertainty, LintingRuleCertainty, type LintQuickFixReplacement } from '../linter-format';
|
|
2
2
|
import type { MergeableRecord } from '../../util/objects';
|
|
3
3
|
import { LintingRuleTag } from '../linter-tags';
|
|
4
|
-
import type { Writable } from 'ts-essentials';
|
|
5
4
|
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
5
|
import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
|
|
6
|
+
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
export type StopCallResult = LintingResult;
|
|
8
8
|
export type StopCallConfig = MergeableRecord;
|
|
9
9
|
export interface StopCallMetadata extends MergeableRecord {
|
|
@@ -12,7 +12,12 @@ export interface StopCallMetadata extends MergeableRecord {
|
|
|
12
12
|
export declare const STOP_CALL: {
|
|
13
13
|
readonly createSearch: () => import("../../search/flowr-search-builder").FlowrSearchBuilder<"all", ["filter"], ParentInformation, Promise<import("../../search/flowr-search").FlowrSearchElements<ParentInformation, [] | import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>>>;
|
|
14
14
|
readonly processSearchResult: (elements: import("../../search/flowr-search").FlowrSearchElements<ParentInformation, import("../../search/flowr-search").FlowrSearchElement<ParentInformation>[]>, _config: MergeableRecord, data: ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
15
|
-
results:
|
|
15
|
+
results: {
|
|
16
|
+
certainty: LintingResultCertainty;
|
|
17
|
+
involvedId: NodeId;
|
|
18
|
+
loc: readonly [startLine: import("../../util/range").Line, startColumn: import("../../util/range").Column, endLine: import("../../util/range").Line, endColumn: import("../../util/range").Column, f?: string | undefined] | undefined;
|
|
19
|
+
quickFix: LintQuickFixReplacement[] | undefined;
|
|
20
|
+
}[];
|
|
16
21
|
'.meta': StopCallMetadata;
|
|
17
22
|
}>;
|
|
18
23
|
readonly prettyPrint: {
|
|
@@ -18,7 +18,7 @@ export declare const USELESS_LOOP: {
|
|
|
18
18
|
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>[]>, useLessLoopConfig: UselessLoopConfig, data: import("../..").ReadonlyFlowrAnalysisProvider<import("../..").KnownParser>) => Promise<{
|
|
19
19
|
results: {
|
|
20
20
|
name: string;
|
|
21
|
-
loc: SourceLocation;
|
|
21
|
+
loc: SourceLocation | undefined;
|
|
22
22
|
certainty: import("../linter-format").LintingResultCertainty;
|
|
23
23
|
involvedId: import("../..").NodeId | import("../..").NodeId[] | undefined;
|
|
24
24
|
}[];
|