critique 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/src/cli.tsx +7 -7
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/cli.tsx
CHANGED
|
@@ -198,25 +198,25 @@ cli
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
const files = parsePatch(gitDiff);
|
|
201
|
-
|
|
201
|
+
|
|
202
202
|
const filteredFiles = files.filter((file) => {
|
|
203
203
|
const fileName = file.newFileName || file.oldFileName || "";
|
|
204
204
|
const baseName = fileName.split("/").pop() || "";
|
|
205
|
-
|
|
205
|
+
|
|
206
206
|
if (IGNORED_FILES.includes(baseName) || baseName.endsWith(".lock")) {
|
|
207
207
|
return false;
|
|
208
208
|
}
|
|
209
|
-
|
|
209
|
+
|
|
210
210
|
const totalLines = file.hunks.reduce((sum, hunk) => sum + hunk.lines.length, 0);
|
|
211
|
-
return totalLines <=
|
|
211
|
+
return totalLines <= 6000;
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
|
|
214
214
|
const sortedFiles = filteredFiles.sort((a, b) => {
|
|
215
215
|
const aSize = a.hunks.reduce((sum, hunk) => sum + hunk.lines.length, 0);
|
|
216
216
|
const bSize = b.hunks.reduce((sum, hunk) => sum + hunk.lines.length, 0);
|
|
217
217
|
return aSize - bSize;
|
|
218
218
|
});
|
|
219
|
-
|
|
219
|
+
|
|
220
220
|
setParsedFiles(sortedFiles);
|
|
221
221
|
} catch (error) {
|
|
222
222
|
setParsedFiles([]);
|
|
@@ -411,7 +411,7 @@ cli
|
|
|
411
411
|
`git checkout HEAD -- "${value}"`,
|
|
412
412
|
{ stdio: "pipe" },
|
|
413
413
|
);
|
|
414
|
-
|
|
414
|
+
|
|
415
415
|
if (error) {
|
|
416
416
|
if (error.includes("did not match any file(s) known to git")) {
|
|
417
417
|
if (fs.existsSync(value)) {
|