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

Only check staged files #74

Open
alallier opened this issue Jun 27, 2016 · 9 comments
Open

Only check staged files #74

alallier opened this issue Jun 27, 2016 · 9 comments

Comments

@alallier
Copy link

Only check staged files when trying to commit

@okonet
Copy link

okonet commented Jun 27, 2016

Not sure if this should be in scope of this library but I've created https://github.com/okonet/lint-staged for this. Check it out and let me know what you think.

@alallier
Copy link
Author

Great, this is exactly what I was looking for; I didn't realize you had another repo for this. Thanks for your quick and diligent response on this!

@okonet
Copy link

okonet commented Jun 27, 2016

Just FYI I'm not the maintainer nor developer of this package... just stumbled upon this issue.

@alallier
Copy link
Author

Thank you I overlooked your username originally.

@alallier
Copy link
Author

I'm going to re-open and wait and see what the owner has to say.

@alallier alallier reopened this Jun 27, 2016
@rehia
Copy link

rehia commented Feb 24, 2017

I agree that this should not be part of this library, at least as far as I understand it.
But I would definitely get a property called onFailure (or something close) or preferably finally, so we can give a npm script name which would be run respectively when an error occurs or always, at the end of the pre-commit.
This would help us start with a script which stash everything but staged files, and unstash those files once scripts have run, whatever the result.

@okonet
Copy link

okonet commented Feb 24, 2017

Actually that would be awesome! Stashing and unstashing is something I'd like to integrate into 🚫💩 lint-staged but it's not trivial at the moment.

@okonet
Copy link

okonet commented Feb 24, 2017

I'm not sure though it can be done as part of the pre-commmit hook.

@bertyhell
Copy link

I've created a script that does exactly this. It uses pre-commit to start a node script that programmatically goes over all the staged files.

https://gist.github.com/bertyhell/c8ae817626e053375bad0d62efc1da7d

Improvements are welcome.

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

No branches or pull requests

4 participants