mirror of
https://github.com/github/codeql-action.git
synced 2025-12-30 11:10:22 +08:00
This change passes in a list of file types to the line counting analysis. These are the languages for the databases being analyzed. Line count analysis is restricted to these files.
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
export interface DetectorOptions {
|
|
}
|
|
/**
|
|
* detecte program language through file extension
|
|
*
|
|
* @export
|
|
* @class LanguageDetector
|
|
*/
|
|
export declare class Languages {
|
|
extensionMap: {
|
|
[key: string]: string;
|
|
};
|
|
/**
|
|
* Creates an instance of Detector.
|
|
*/
|
|
constructor();
|
|
/**
|
|
* load language before detecting
|
|
*/
|
|
private loadExtensionMap;
|
|
/**
|
|
* Retrieve the regular expressions for a given language.
|
|
* This is incomplete, but covers most of the languages we
|
|
* see in the wild.
|
|
*
|
|
* @param language the language to retrieve regexes for
|
|
*/
|
|
getRegexes(language: string): Regexes;
|
|
/**
|
|
* return extension map
|
|
*/
|
|
getExtensionMap(): {
|
|
[key: string]: string;
|
|
};
|
|
/**
|
|
* get file type through a path
|
|
*/
|
|
getType(path: string): string;
|
|
}
|
|
export interface Regexes {
|
|
singleLineComment: RegExp;
|
|
multiLineCommentOpen: RegExp;
|
|
multiLineCommentOpenStart: RegExp;
|
|
multiLineCommentClose: RegExp;
|
|
multiLineCommentCloseEnd: RegExp;
|
|
multiLineCommentOpenAndClose: RegExp;
|
|
}
|