Skip to content

Commit 11e4d5d

Browse files
committed
[#32]: Additional logs
1 parent 2000000 commit 11e4d5d

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

dist/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35259,7 +35259,8 @@ function get_line_info(compiler, line) {
3525935259
*/
3526035260
function is_project_file(line, prefix) {
3526135261
// For absolute paths we only consider the ones prefix with 'work_dir'
35262-
if(external_node_path_namespaceObject.isAbsolute(line)) {
35262+
if (external_node_path_namespaceObject.isAbsolute(line)) {
35263+
debug_log(`is_project_file: checking line:${line} and prefix:${prefix} -> ${line.startsWith(prefix)}`);
3526335264
return line.startsWith(prefix);
3526435265
}
3526535266

@@ -35281,6 +35282,8 @@ function process_compile_output() {
3528135282
var num_warnings = 0;
3528235283
var num_errors = 0;
3528335284

35285+
debug_log(`process_compile_output: prefix_dir=${prefix_dir} exclude_dir=${exclude_dir} compiler=${compiler}`);
35286+
3528435287
const splitLines = str => str.split(/\r?\n/);
3528535288
const initialList = splitLines(compile_result).map(line => line.trimStart());
3528635289
initialList.forEach(function (part, index) {
@@ -35292,12 +35295,12 @@ function process_compile_output() {
3529235295
uniqueLines.forEach(line => {
3529335296
line = make_dir_universal(line).replace(prefix_dir, "");
3529435297

35295-
debug_log(`Checking line: ${line} excluded=${excluded(line, exclude_dir)} and warning/error=${check_if_valid_line(compiler, line)}`)
35296-
if (!excluded(line, exclude_dir) && check_if_valid_line(compiler, line)) {
35297-
debug_log(`Parsing line: ${line}`);
35298-
35298+
debug_log(`Checking line: ${line} \n\t is_project_file=${is_project_file(line, prefix_dir)} excluded=${excluded(line, exclude_dir)} and warning/error=${check_if_valid_line(compiler, line)}`)
35299+
if (is_project_file(line, prefix_dir) && !excluded(line, exclude_dir) && check_if_valid_line(compiler, line)) {
3529935300
const [file_path, file_line_start, file_line_end, type] = get_line_info(compiler, line);
3530035301

35302+
debug_log(`Line info: file_path= ${file_path} file_line_start=${file_line_start} file_line_end=${file_line_end} type=${type}`);
35303+
3530135304
// warning/error description
3530235305
const color_mark = type == "error" ? "-" : "!";
3530335306
type == "error" ? num_errors++ : num_warnings++;

index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ function get_line_info(compiler, line) {
161161
*/
162162
function is_project_file(line, prefix) {
163163
// For absolute paths we only consider the ones prefix with 'work_dir'
164-
if(path.isAbsolute(line)) {
164+
if (path.isAbsolute(line)) {
165+
debug_log(`is_project_file: checking line:${line} and prefix:${prefix} -> ${line.startsWith(prefix)}`);
165166
return line.startsWith(prefix);
166167
}
167168

@@ -183,6 +184,8 @@ function process_compile_output() {
183184
var num_warnings = 0;
184185
var num_errors = 0;
185186

187+
debug_log(`process_compile_output: prefix_dir=${prefix_dir} exclude_dir=${exclude_dir} compiler=${compiler}`);
188+
186189
const splitLines = str => str.split(/\r?\n/);
187190
const initialList = splitLines(compile_result).map(line => line.trimStart());
188191
initialList.forEach(function (part, index) {
@@ -194,12 +197,12 @@ function process_compile_output() {
194197
uniqueLines.forEach(line => {
195198
line = make_dir_universal(line).replace(prefix_dir, "");
196199

197-
debug_log(`Checking line: ${line} excluded=${excluded(line, exclude_dir)} and warning/error=${check_if_valid_line(compiler, line)}`)
198-
if (!excluded(line, exclude_dir) && check_if_valid_line(compiler, line)) {
199-
debug_log(`Parsing line: ${line}`);
200-
200+
debug_log(`Checking line: ${line} \n\t is_project_file=${is_project_file(line, prefix_dir)} excluded=${excluded(line, exclude_dir)} and warning/error=${check_if_valid_line(compiler, line)}`)
201+
if (is_project_file(line, prefix_dir) && !excluded(line, exclude_dir) && check_if_valid_line(compiler, line)) {
201202
const [file_path, file_line_start, file_line_end, type] = get_line_info(compiler, line);
202203

204+
debug_log(`Line info: file_path= ${file_path} file_line_start=${file_line_start} file_line_end=${file_line_end} type=${type}`);
205+
203206
// warning/error description
204207
const color_mark = type == "error" ? "-" : "!";
205208
type == "error" ? num_errors++ : num_warnings++;

0 commit comments

Comments
 (0)