-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
Feature/pre commit hook #321
base: main
Are you sure you want to change the base?
Conversation
What does it do? For who is this? |
It's a wrapper to use
For |
|
Will add an example on how to enable it.
Basically just run
It seems to me to be the cleanest way to bring the configuration for running |
Ideally the |
Just wondering if this is likely to be merged? |
@wooorm Will this be merged anytime soon? Not having I could create a cleaned-up version of this pull request (i.e. without the |
There are open issues with this PR. Notably docs and examples. But it’s still in the discussion phase anyway: needs more convincing for why this is needed here. How should this be maintained? Why does it need to be here? It looks like
I don‘t understand this. |
Agreed
This is the authorative source for Alex, ergo it is preferable to sit within this repo. Maintenance would be ~nil unless wholesale changes were made to the cli itself.
I think you may be mixing up In essence pre-commit-hooks defines what should be installed/run/how and pre-commit-config defines what the user wants to include.
Totally this.
It's not a python world thing. we have pre-commit in ~11k repos of which < 1% are python. Most are java or node. Pre-commit is more akin to a cross platform/language/ecosystem alternative to nodes husky. |
I couldn't push changes to this branch (obviously) since I don't have rights to @JensHeinrich 's branch. So I've created my own fork and feature branch, which you can find here: https://github.com/jussihi/alex/tree/feature-pre-commit. I used @JensHeinrich's commits as a base for my branch. I cherry-picked 3 first commits - I've omitted the .pre-commit-config.yaml from there since running |
There’s a potential problem with a single person maintaining this for years in the past and in the future, a drive-by commit from someone who likes pre-commits and then potentially leaving for the woods: I can’t maintain code I don’t use. I can only remove this 3 years down the road.
So: users have their own We can add this in the readme here?
This was a separate point from the earlier: I meant to say that I see many “wrapper” repos in the list: https://pre-commit.com/hooks.html. So many tools don’t include pre-commit-hooks themselves. |
I completely understand this. I cannot guarantee that I would be fixing this in the future if something breaks, but it seems like there are more people interested in having this added to pre-commit than just me (see this thread). Also, once more people would use it with pre-commit, the "integration" would definitely be well maintained.
Exactly.
Because You can think
Yes, I created my own copy of this feature branch, should I create a PR of it?
This is another way to do it. We just need to hope that the Obviously there are pros and cons in both ways of doing this, feel free to choose what are pros and what are cons:
|
Totally understand, that is the perennial issue with open source and as the maintainer it is absolutely the right challenge to make. From hooks I maintain, I've only had to edit the
To put it in their own config its a little different: - repo: local # Replace if https://github.com/get-alex/alex/pull/321 is merged
hooks:
- id: alex-js
name: Alex.js
description: Find gender favoring, polarizing, race related, religion inconsiderate, or other unequal phrasing in text.
entry: alex
language: node
types:
- markdown
additional_dependencies:
- alex The downside of this approach is
Certainly could, or, if you'd prefer, we could create a "mirror" repo like e.g. https://github.com/pre-commit/mirrors-prettier which would remove any potential burden from yourself / this project? I'd certainly be happy to do that 👍 |
The biggest advantage of keeping it here, is any new tag / version of alex can be easily upgraded too by just running |
Also thanks to @jussihi and @adam-moss for better explaining the why |
I made a mirror repo: https://github.com/mfisher87/alexjs-pre-commit-mirror This is my first time doing so, would appreciate any collaboration :) |
Add description as used in get-alex/alex#321
Small wrapper to use alex as a pre-commit hook