-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add git pre-commit hook to lint and test staged files #18230
Comments
Personally, I dislike workflows that add latency to committing, so it would be nice if there's a way to opt-out somehow. |
@jryans with |
Sure, it's good enough for me at least. I do wonder if there's some way to know how desired this actually is, so we would know if it should be opt-in vs opt-out... |
@vector-im/element-web how do folks feel about this proposal? |
pre-commit hooks are strictly opt-in anyway, because they require setup in the local git workdir. So this would amount to a recommendation for contributors rather than anything enforced. I used a pre-commit hook in Synapse to do some linting. It was often useful. But also I often did So generally +1 to making it easy to set up a pre-commit hook. |
Using things like husky do set up the commit hooks automatically. |
husky == https://typicode.github.io/husky/, ftr |
We've discussed this in the EW weekly today and concluded that having linting available as a pre-commit hook would be valuable. There was no consensus on also running tests on staged files as that might blow up the hook runtime quite a bit. To move this forward, we'd like for somebody to set up a commit hook script that triggers the linter on staged files and add documentation on how to install (and skip) it. |
Considering that I've been a huge champion on the solution and I'm still getting notifications for it, I'll get it done today within the next few hours. 😄 |
@t3chguy @Johennes solved by: |
To close this issue we'll also need to do similar for https://github.com/vector-im/element-desktop/ |
Thanks @Palid for kicking this off |
@t3chguy on it! |
Will be continued on Monday, unless someone takes over. Some stuff came out. |
@Palid thanks again for kick starting this. Were you still planning on wrapping up those PRs? |
@Johennes yeah, just been busy and didn't get pinged 😅 |
No description provided.
The text was updated successfully, but these errors were encountered: