@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
47 lines (46 loc) • 2.84 kB
TypeScript
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
import type { ParsedQueryLine } from '../../query';
import Joi from 'joi';
import { executeLinterQuery } from './linter-query-executor';
import { type LintingRuleNames } from '../../../linter/linter-rules';
import { type ConfiguredLintingRule, LintingResultCertainty } from '../../../linter/linter-format';
import { type OutputFormatter } from '../../../util/text/ansi';
import type { FlowrConfig } from '../../../config';
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
import type { CommandCompletions } from '../../../cli/repl/core';
import { type LintResultsByRule, LinterOutputFormat } from '../../../linter/linter-output';
export interface LinterQuery extends BaseQueryFormat {
readonly type: 'linter';
/**
* The rules to lint for. If unset, all rules will be included.
* Optionally, a {@link ConfiguredLintingRule} can be provided, which additionally includes custom user-supplied values for the linting rules' configurations.
*/
readonly rules?: (LintingRuleNames | ConfiguredLintingRule)[];
/** Print the findings in a machine-readable {@link LinterOutputFormat|format} instead of the human-readable summary. */
readonly format?: LinterOutputFormat;
}
export interface LinterQueryResult extends BaseQueryResult {
/**
* The results of the linter query, which returns a set of linting results for each rule that was executed.
*/
readonly results: LintResultsByRule;
/** The findings rendered in the requested {@link LinterQuery#format|format}, if one was requested. */
readonly formatted?: string;
}
declare function linterQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'linter'>;
declare function linterQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
export declare const LinterQueryDefinition: {
readonly title: "Linter Query";
readonly executor: typeof executeLinterQuery;
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
readonly completer: typeof linterQueryCompleter;
readonly fromLine: typeof linterQueryLineParser;
readonly syntax: "@linter [rules:<r1>,<r2>,...] [format:<fmt>] <code | file://path>";
readonly schema: Joi.ObjectSchema<any>;
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, _queries: readonly import("../../query").Query[], certainty: LintingResultCertainty | undefined) => ((string & {
__brand?: "node-id";
}) | (number & {
__brand?: "node-id";
}))[];
};
export {};