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

Get rid of gitDir config option and be smart about it #271

Comments

@okonet
Copy link
Collaborator

okonet commented Sep 8, 2017

Ideally, users with complex setup should not suffer trying to setup lint-staged right. There are plenty of issues related just to that:

I'm wondering if resolving to git root and taking care of execution context automatically would make gitDir option obsolete and solve all those issues and make the DX even better?

⚠︎ This issue is meant to be a discussion before proceeding with the actual implementation.

cc @ai @FezVrasta

@sudo-suhas
Copy link
Collaborator

Is it as simple as keep looking in the parent directory until you encounter a git repo?

@okonet
Copy link
Collaborator Author

okonet commented Sep 8, 2017

Well, that's why I created the issue. I don't know yet but it seems like it. I'm probably missing something. For instance there are users with a very unconventional setup #232 so I don't know how it will affect them yet.

@FezVrasta
Copy link
Contributor

FezVrasta commented Sep 8, 2017

If you are going to make this change you'll also want to change the way the glob patterns are matched (changing the root dir to the actual package.json folder and not the .git folder anymore).

@okonet
Copy link
Collaborator Author

okonet commented Sep 8, 2017

@FezVrasta I'm not sure about that... Why do you think so?

Let's keep this discussion inside your original issue.

@frontsideair
Copy link

The git dir can be found the same way husky finds it, and the dependencies are already installed too.

@okonet
Copy link
Collaborator Author

okonet commented Sep 13, 2017

@frontsideair yeah, that is what I was thinking about. I'm not concerned about the implementation but about possible side-effects for some users. But it seems to be safe.

@okonet okonet changed the title Idea: Get rid of gitDir config option and be smart about it Get rid of gitDir config option and be smart about it Sep 13, 2017
@okonet okonet added Idea and removed question labels Sep 13, 2017
@mattfysh
Copy link

mattfysh commented Oct 18, 2017

Anything I can do to help move this along? Looking at using lerna, yarn workspaces, husky and lint-staged together with multiple packages stored in <gitroot>/packages/app-name

@okonet
Copy link
Collaborator Author

okonet commented Oct 19, 2017

@mattfysh do you think the proposed solution will work? You could create a PR by looking at how husky does it. Probably there is an npm package to do that ;)

@mattfysh
Copy link

mattfysh commented Nov 4, 2017

I think I'll try to tackle this over the weekend using:

okonet pushed a commit that referenced this issue Nov 11, 2017
* remove gitDir config option and close #271
* cleanup tests

* update based on feedback

* update message for gitDir

* add snapshot test for gitDir config

* updated based on feedback

* Minor whitespace adjustment for deprecation msg
okonet pushed a commit that referenced this issue Nov 11, 2017
* Remove `gitDir` config option
* Automatically resolve `.git` directory in the project

Closes #271

BREAKING CHANGE: `gitDir` option deprecated and will be ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment