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

Return files relative to git directory #120

Closed
wants to merge 1 commit into from

Conversation

patrick91
Copy link

It was returning files relative to the current working directory, not the git one.

Should also fix #118

It was returning files relative to the current working directory, not the git one.

Should also fix lint-staged#118
@patrick91
Copy link
Author

@rodneyrehm can you have a look at this? I just had a look at the failing test, and I'm not sure if what I have done is correct :)

@rodneyrehm
Copy link
Contributor

Maybe it's time to clean up with the directory mess?

I've been trying a few things and it's it turns out that paths used for filtering should be relative to the git root, while paths provided to the linters should be absolute, so that we don't run into issues with different working directories. Give me a minute to patch this up…

Also I believe the matchBase option, currently enabled on minimatch, should be removed in order to allow specific filtering. But that would be a breaking change, as *.js would then only find JavaScript files at the root of the git directory. Users would have to correct their patterns to use **/*.js instead.

@okonet
Copy link
Collaborator

okonet commented Jan 15, 2017

Why do you need to remove matchBase? If it isn't absolutely necessary I'd like to keep it to simplify configuration. Generally we're only interested in file extensions most of the time.

@rodneyrehm
Copy link
Contributor

With that option set it is impossible to match only files at the root level. I don't have this issue myself, it's just something I noticed while tinkering with your setup.

@okonet
Copy link
Collaborator

okonet commented Jan 15, 2017

I believe no one expressed such a problem before so I'm for the simplicity of the config.

@okonet okonet closed this in 41ae0cb Jan 18, 2017
@patrick91 patrick91 deleted the fix/base-url branch January 18, 2017 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Wrong path with gitDir
3 participants