@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
52 lines (51 loc) • 3.14 kB
TypeScript
import { FlowrAnalyzerProjectDiscoveryPlugin } from './flowr-analyzer-project-discovery-plugin';
import { SemVer } from 'semver';
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
import type { RProjectAnalysisRequest } from '../../context/flowr-analyzer-files-context';
import type { RParseRequest } from '../../../r-bridge/retriever';
import type { FlowrFile } from '../../context/flowr-file';
/**
* The ignore files a {@link FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin} can respect.
* They differ in their pattern language, see {@link ignoreMatcher}.
*/
export declare enum IgnoreFileKind {
/** `.gitignore`, gitignore-style globs */
Gitignore = "gitignore",
/** `.Rbuildignore`, one (Perl-compatible) regular expression per line, as used by `R CMD build` */
Rbuildignore = "rbuildignore"
}
/**
* Decorator around any {@link FlowrAnalyzerProjectDiscoveryPlugin} that filters the discovered files
* by the ignore files found at the project root. Ignore files that do not exist are skipped, so with
* none of them present the inner plugin's results are returned unchanged.
*
* Use {@link FlowrAnalyzerGitignoreProjectDiscoveryPlugin} (`'project-discovery:gitignore'`),
* {@link FlowrAnalyzerRbuildignoreProjectDiscoveryPlugin} (`'project-discovery:rbuildignore'`), or
* `'project-discovery:ignore-files'` for both. As every variant wraps an inner discovery plugin, they
* can also be nested to combine them with a custom discovery plugin.
*/
export declare class FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin extends FlowrAnalyzerProjectDiscoveryPlugin {
readonly name: string;
readonly description: string;
readonly version: SemVer;
private readonly inner;
private readonly kinds;
/**
* @param kinds - the ignore files to respect
* @param inner - the discovery plugin providing the files to filter
*/
constructor(kinds?: readonly IgnoreFileKind[], inner?: FlowrAnalyzerProjectDiscoveryPlugin);
protected process(context: FlowrAnalyzerContext, args: RProjectAnalysisRequest): (RParseRequest | FlowrFile<string>)[];
}
/** Filters the discovered files by the `.gitignore` at the project root, see {@link FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin}. */
export declare class FlowrAnalyzerGitignoreProjectDiscoveryPlugin extends FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin {
readonly name = "flowr-analyzer-gitignore-project-discovery-plugin";
readonly description = "Wraps a project discovery plugin and filters results by .gitignore rules.";
constructor(inner?: FlowrAnalyzerProjectDiscoveryPlugin);
}
/** Filters the discovered files by the `.Rbuildignore` at the package root, see {@link FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin}. */
export declare class FlowrAnalyzerRbuildignoreProjectDiscoveryPlugin extends FlowrAnalyzerIgnoreFileProjectDiscoveryPlugin {
readonly name = "flowr-analyzer-rbuildignore-project-discovery-plugin";
readonly description = "Wraps a project discovery plugin and filters results by .Rbuildignore rules.";
constructor(inner?: FlowrAnalyzerProjectDiscoveryPlugin);
}