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

hook to sort hooks in .pre-commit-config.yaml #62

Closed
guykisel opened this issue Jun 3, 2015 · 5 comments
Closed

hook to sort hooks in .pre-commit-config.yaml #62

guykisel opened this issue Jun 3, 2015 · 5 comments

Comments

@guykisel
Copy link
Contributor

guykisel commented Jun 3, 2015

This might sound a little meta but it would be nice to have a hook that alphabetically sorts the hooks in the .pre-commit-config.yaml in my repo.

@asottile
Copy link
Member

asottile commented Jun 3, 2015

Would be pretty easy. The problem with yaml rewriting is it's hard to make it retain the formatting as seen in pre-commit/pre-commit#210 and pre-commit/pre-commit#211

The runtime order is also sometimes important (like I'd rather run autopep8 before flake8, whitespace fixers before anything else, etc. etc.). But yeah I could see some people wanting alphabetized so it seems like a good idea for a hook.

@guykisel
Copy link
Contributor Author

guykisel commented Jun 3, 2015

My main motivation in wanting alphabetized hooks is to make it easy to compare the hooks I'm using vs the hooks that are available to see if there are any I've forgotten to add or added twice.

@asottile
Copy link
Member

asottile commented Jun 3, 2015

ooh I think we could do that better in the parent project. I've wanted to make a pre-commit list-hooks which shows what's installed / what's not and probably pre-commit search ... as well since we have data on http://pre-commit.com/all-hooks.json

How does that sound?

@guykisel
Copy link
Contributor Author

guykisel commented Jun 3, 2015

Sounds good to me.

A nice-to-have would be if pre-commit search was smart enough to show hooks related to the file types in your repo.

@asottile
Copy link
Member

asottile commented Feb 5, 2020

closing since this hasn't really moved forward in years

@asottile asottile closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants