Skip to content

Commit cddc058

Browse files
chore: remove ESLint configuration and CI workflow; enhance debugging in ccpRunner.ts and statsManager.ts
1 parent bcba96b commit cddc058

7 files changed

Lines changed: 24 additions & 137 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<a href="https://github.com/christliebdela/Comment-Cleaner-VsCode-Ext/issues"><img src="https://img.shields.io/github/issues/christliebdela/Comment-Cleaner-VsCode-Ext?style=flat-square&color=000000&labelColor=222222" alt="Issues"></a>
1111
<a href="https://github.com/christliebdela/Comment-Cleaner-VsCode-Ext/pulls"><img src="https://img.shields.io/github/issues-pr/christliebdela/Comment-Cleaner-VsCode-Ext?style=flat-square&color=000000&labelColor=222222" alt="Pull Requests"></a>
1212
<a href="https://github.com/christliebdela/Comment-Cleaner-VsCode-Ext/blob/main/LICENSE"><img src="https://img.shields.io/github/license/christliebdela/Comment-Cleaner-VsCode-Ext?style=flat-square&color=000000&labelColor=222222" alt="License"></a>
13-
<a href="https://github.com/christliebdela/Comment-Cleaner-VsCode-Ext/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/christliebdela/Comment-Cleaner-VsCode-Ext/ci.yml?branch=main&style=flat-square&color=000000&labelColor=222222" alt="CI"></a>
1413
</p>
1514

1615
## Current Release

eslint.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/ccpRunner.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,32 @@ function parseCleanResults(output: string, filePath: string): any {
5454
linesRemoved: 0,
5555
sizeReduction: 0,
5656
sizePercentage: 0
57-
// 'dryRun' field removed
5857
};
5958

60-
// Match patterns with more flexible spacing
61-
const commentMatch = output.match(/Removed\s+approximately\s+(\d+)\s+comments\s+\((\d+)\s+lines\)/i);
62-
const sizeMatch = output.match(/File\s+size\s+reduced\s+by\s+(\d+)\s+bytes\s+\(([0-9.]+)%\)/i);
59+
// Log the output for debugging
60+
console.log("Raw Python output to parse:", output);
61+
62+
// Updated regex patterns with more flexible whitespace matching
63+
const commentMatch = output.match(/Removed\s+approximately\s+(\d+)\s+comments?\s*\((\d+)\s+lines?\)/i) ||
64+
output.match(/Removed.*?(\d+).*?comment.*?\((\d+).*?line/i);
65+
66+
const sizeMatch = output.match(/File\s+size\s+reduced\s+by\s+(\d+)\s+bytes\s+\(([0-9.]+)%\)/i) ||
67+
output.match(/reduced.*?by\s+(\d+)\s+bytes.*?\(([0-9.]+)%\)/i);
6368

6469
if (commentMatch) {
6570
results.commentCount = parseInt(commentMatch[1]);
6671
results.linesRemoved = parseInt(commentMatch[2]);
72+
console.log("Matched comments:", results.commentCount, "lines:", results.linesRemoved);
73+
} else {
74+
console.log("Failed to match comment pattern in output");
6775
}
6876

6977
if (sizeMatch) {
7078
results.sizeReduction = parseInt(sizeMatch[1]);
7179
results.sizePercentage = parseFloat(sizeMatch[2]);
80+
console.log("Matched size:", results.sizeReduction, "percentage:", results.sizePercentage);
81+
} else {
82+
console.log("Failed to match size pattern in output");
7283
}
7384

7485
return results;

src/statsManager.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,22 @@ export class StatisticsManager {
5353
return;
5454
}
5555

56-
// Log incoming results for debugging
57-
console.log("Updating stats with:", fileResults);
56+
// Enhanced debugging
57+
console.log("Updating stats with:", JSON.stringify(fileResults, null, 2));
58+
59+
// Check for missing properties
60+
fileResults.forEach((file, index) => {
61+
if (file.commentCount === undefined) console.log(`Warning: file[${index}].commentCount is undefined`);
62+
if (file.linesRemoved === undefined) console.log(`Warning: file[${index}].linesRemoved is undefined`);
63+
if (file.sizeReduction === undefined) console.log(`Warning: file[${index}].sizeReduction is undefined`);
64+
});
5865

5966
const totalComments = fileResults.reduce((sum, file) => sum + (file.commentCount || 0), 0);
6067
const totalLines = fileResults.reduce((sum, file) => sum + (file.linesRemoved || 0), 0);
6168
const totalSize = fileResults.reduce((sum, file) => sum + (file.sizeReduction || 0), 0);
6269

6370
console.log(`Stats summary: ${totalComments} comments, ${totalLines} lines, ${totalSize} bytes`);
6471

65-
// Don't update stats for dry runs
66-
if (fileResults[0].dryRun) {
67-
console.log("Skipping stats update for dry run");
68-
return;
69-
}
70-
7172
this.stats.filesProcessed += fileResults.length;
7273
this.stats.totalComments += totalComments;
7374
this.stats.totalLines += totalLines;

src/test/suite/index.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)