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
git hooks lint working directory instead of staged changes #1122
Comments
I don't think it's a good idea to remove the hooks, but I think they should be on
I'd be satisfied moving them to a plugin, but I still feel they are best practice. I'm very opposed to removing them completely. |
I'm not really in favor of removing the git hooks completely. I also don't mind them running on I don't understand what you mean by
I don't typically run those commands in one line like that, but know people who do. My point wasn't about running |
I did because it was there before. I wouldn't call it bold though. What I like do on my projects is:
I recommend using lint-staged. It's excellent. Lemme know if you wanna see an example. Didn't wanna leave you out. Hey dude! |
@skellock I think linting and formatting staged files only is the right way to go here. I personally prefer to not compile or test on prepush because I push to a CI server that does it anyways. However, I agree that compiling and testing on prepush is a reasonable default. Honestly I wasn't too interested in fixing it in just my project. It's only a minor annoyance with many work-arounds. I was just documenting it so it can hopefully be fixed in Ignite eventually. |
@skellock BOLD! BOLD BOLD BOLD BOLD BOLD! In all seriousness I think it depends on the shop, and it depends how long your tests take. In some projects we're seeing 30seconds of tests/lint. Not common, but at some point it makes a simple commit throw you off your timing. In any case, def want to keep the commit hooks all around, just need to tweak them. 👍 |
I like my git hooks like I like my coffee. Bold and heartburn inducing. |
Git hooks have been removed per this conversation: infinitered/ignite-andross#120 Relevant commits: |
Right now the git hooks that are run lint the current working directory, not the currently staged changes. This causes 2 problems.
I may have changes I want to commit, and also have some changes that are not ready to commit. I cannot commit my ready changes unless the files I'm not even committing also pass lint.
The second problem is more serious. Suppose you have a single file with changes you want to commit. You run
git add file.js; git commit
and see some lint errors. Now you quickly fix those errors andgit commit
again. This time, it lets you commit, but you didn't even stage the changes fixing the lint. Now your non-linted changes have been committed to the repo.The text was updated successfully, but these errors were encountered: