mirror of
https://github.com/github/codeql-action.git
synced 2026-01-05 06:00:32 +08:00
This commit only adds a single package and all of its transitive dependencies. The github-linguist package will be used for counting lines of code as a baseline for databases we are analyzing.
38 lines
763 B
TypeScript
38 lines
763 B
TypeScript
/**
|
|
* detect file info
|
|
*/
|
|
export interface LineInfo {
|
|
total: number;
|
|
code: number;
|
|
comment: number;
|
|
}
|
|
export interface FileInfo {
|
|
name: string;
|
|
languages: string;
|
|
size: number;
|
|
lines: LineInfo;
|
|
}
|
|
/**
|
|
* Collect language info for a single file
|
|
*/
|
|
export declare class LocFile {
|
|
private debug;
|
|
path: string;
|
|
private rawPath;
|
|
private language;
|
|
/**
|
|
* Creates an instance of LocFile.
|
|
*/
|
|
constructor(rawPath: string, debug?: boolean);
|
|
/**
|
|
* get file type through a path
|
|
*/
|
|
private getType;
|
|
private filterData;
|
|
/**
|
|
* Get file info when LocFile init
|
|
*/
|
|
getFileInfo(data?: string): Promise<FileInfo>;
|
|
getFileInfoByContent(name: string, data: string): FileInfo;
|
|
}
|