UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

37 lines 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FlowrAnalyzerLicenseFilePlugin = void 0; const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin"); const semver_1 = require("semver"); const flowr_file_1 = require("../../context/flowr-file"); const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source"); const FileNamePattern = /license(\.md|\.txt)?$/i; /** * This plugin provides supports for the identification of license files. */ class FlowrAnalyzerLicenseFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin { name = 'flowr-analyzer-license-files-plugin'; description = 'This plugin provides support for loading license files.'; version = new semver_1.SemVer('0.1.0'); pathPattern; /** * Creates a new instance of the TEST file plugin. * @param pathPattern - The pathPattern to identify TEST files, see {@link FileNamePattern} for the default pathPattern. */ constructor(pathPattern = FileNamePattern) { super(); this.pathPattern = pathPattern; } applies(file) { return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString())); } /** * Processes the given file, assigning it the {@link FileRole.License} role. */ process(_ctx, file) { file.assignRole(flowr_file_1.FileRole.License); return file; } } exports.FlowrAnalyzerLicenseFilePlugin = FlowrAnalyzerLicenseFilePlugin; //# sourceMappingURL=flowr-analyzer-license-file-plugin.js.map