Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle negative gitignore patterns correctly #195

Merged
merged 2 commits into from
Mar 18, 2017

Conversation

marionebl
Copy link
Contributor

  • split out getGitIgnores from getIgnores
  • adapt test cases accordingly
  • extend gitignore test case with negative pattern
  • invert gitignore patterns and feed sotred as glob instead of opts.ignore

fix #154

marionebl and others added 2 commits March 17, 2017 23:55
*  split out getGitIgnores from getIgnores
*  adapt test cases accordingly
*  extend gitignore test case with negative pattern
*  invert gitignore patterns and feed sotred as glob instead of opts.ignore

fix #154
@sindresorhus sindresorhus merged commit f8e1e3d into master Mar 18, 2017
@sindresorhus sindresorhus deleted the fix/handle-negative-gitignore-patterns branch March 18, 2017 08:22
@sindresorhus
Copy link
Member

Yay! Thanks for fixing this. It's been eating at me for a long time.

@sindresorhus
Copy link
Member

@schnittstabil @JonnyBurger I already merged this as it looks good to me, but your review would still be welcome :)

@schnittstabil
Copy link
Contributor

schnittstabil commented Mar 18, 2017

@marionebl Thanks for exploring this.

Hmm, as far as I can see, negative .gitignore entries will always be linted from now on:

# .gitignore
!bar.js
xo.lintFiles('foo.js'); // will lint 'bar.js', won't it?

@JonnyBurger
Copy link

@schnittstabil @marionebl You are right, I was able to reproduce the bug you described.
I added a failing test to demonstrate: #199.

marionebl added a commit that referenced this pull request Apr 2, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this pull request Apr 3, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this pull request Apr 30, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this pull request Apr 30, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Negative .gitignore rules cause xo to pass everything
4 participants