Skip to content

Commit 8c3a38d

Browse files
committed
diff: list only changed, added and modified files
Use --diff-filter=ACM option to `git diff` command in order to only list Added (A), Changed (C) and Modified (M) files. There is no reason to lint deleted files and it was causing some problemas as reported on https://github.com/grvcoelho/lint-diff/issues/3
1 parent f43e1dd commit 8c3a38d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lint-diff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const linter = new CLIEngine()
3030
const formatter = linter.getFormatter()
3131

3232
const getChangedFiles = pipeP(
33-
commitRange => exec('git', ['diff', commitRange, '--name-only']),
33+
commitRange => exec('git', ['diff', commitRange, '--name-only', '--diff-filter=ACM']),
3434
prop('stdout'),
3535
split('\n'),
3636
filter(endsWith('.js')),

0 commit comments

Comments
 (0)