Skip to content

Commit e963ba2

Browse files
committed
Remove getIgnorePatterns
In certain edge cases it would spit out warnings, saying all files are ignored. Will be replaced with proper usage of 'preprocess'.
1 parent 58f4853 commit e963ba2

File tree

4 files changed

+1
-25
lines changed

4 files changed

+1
-25
lines changed

src/__snapshots__/index.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
exports[`plugin should match expected export 1`] = `
44
Object {
55
"diff": Object {
6-
"ignorePatterns": Array [],
76
"overrides": Array [
87
Object {
98
"files": Array [
@@ -17,7 +16,6 @@ Object {
1716
],
1817
},
1918
"staged": Object {
20-
"ignorePatterns": Array [],
2119
"overrides": Array [
2220
Object {
2321
"files": Array [

src/__snapshots__/processors.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`configs diff 1`] = `
44
Object {
5-
"ignorePatterns": Array [],
65
"overrides": Array [
76
Object {
87
"files": Array [
@@ -19,7 +18,6 @@ Object {
1918

2019
exports[`configs staged 1`] = `
2120
Object {
22-
"ignorePatterns": Array [],
2321
"overrides": Array [
2422
Object {
2523
"files": Array [

src/git.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,6 @@ const getGitFileList = (): string[] => {
7878
return gitFileListCache;
7979
};
8080

81-
const getIgnorePatterns = (staged = false): string[] => {
82-
const changedFiles = getDiffFileList(staged);
83-
const repositoryFiles = getGitFileList();
84-
85-
const unchangedFiles = repositoryFiles
86-
.filter((x) => !changedFiles.includes(x))
87-
.map((x) => path.join("/", path.relative(process.cwd(), x)));
88-
89-
return unchangedFiles;
90-
};
91-
9281
const isHunkHeader = (input: string) => {
9382
const hunkHeaderRE = new RegExp(/^@@ .* @@/g);
9483
return input.match(hunkHeaderRE);
@@ -131,11 +120,5 @@ const getRangesForDiff = (diff: string): Range[] =>
131120
.map(getRangeForChangedLines)
132121
.filter(removeNullRanges);
133122

134-
export {
135-
getDiffForFile,
136-
getIgnorePatterns,
137-
getRangesForDiff,
138-
getDiffFileList,
139-
getGitFileList,
140-
};
123+
export { getDiffForFile, getRangesForDiff, getDiffFileList, getGitFileList };
141124
export type { Range };

src/processors.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Range } from "./git";
33
import {
44
getDiffFileList,
55
getDiffForFile,
6-
getIgnorePatterns,
76
getRangesForDiff,
87
} from "./git";
98

@@ -53,7 +52,6 @@ const diffConfig = {
5352
processor: "diff/diff",
5453
},
5554
],
56-
ignorePatterns: getIgnorePatterns(),
5755
};
5856

5957
const staged = {
@@ -97,7 +95,6 @@ const stagedConfig = {
9795
processor: "diff/staged",
9896
},
9997
],
100-
ignorePatterns: getIgnorePatterns(STAGED),
10198
};
10299

103100
export { diff, diffConfig, staged, stagedConfig };

0 commit comments

Comments
 (0)