Skip to content

Commit

Permalink
fix: also use .prettierignore from current working directory (prettie…
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Jan 15, 2019
1 parent 157d4b1 commit 43b5c05
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/index.js
Expand Up @@ -29,16 +29,22 @@ export default (

onFoundSinceRevision && onFoundSinceRevision(scm.name, revision);

const rootIgnorer = createIgnorer(directory);
const cwdIgnorer =
process.cwd() !== directory ? createIgnorer(process.cwd()) : () => true;

const changedFiles = scm
.getChangedFiles(directory, revision, staged)
.filter(isSupportedExtension)
.filter(createIgnorer(directory));
.filter(rootIgnorer)
.filter(cwdIgnorer);

const unstagedFiles = staged
? scm
.getUnstagedChangedFiles(directory, revision)
.filter(isSupportedExtension)
.filter(createIgnorer(directory))
.filter(rootIgnorer)
.filter(cwdIgnorer)
: [];

const wasFullyStaged = f => unstagedFiles.indexOf(f) < 0;
Expand Down

0 comments on commit 43b5c05

Please sign in to comment.