Allow aliasing a hook and calling it by it's alias by s0undt3ch · Pull Request #886 · pre-commit/pre-commit · GitHub
Skip to content

Allow aliasing a hook and calling it by it's alias - #886

Merged
asottile merged 6 commits into
pre-commit:masterfrom
s0undt3ch:features/repo-alias
Dec 27, 2018
Merged

asottile merged 6 commits into
pre-commit:masterfrom
s0undt3ch:features/repo-alias

Conversation

@s0undt3ch

Copy link
Copy Markdown
Contributor

This is the least intrusive change.

We could consider using the alias in the output instead of the ID, but I'll defer any more directions on this PR through it's review comments.

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

@asottile asottile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this, it's simple enough, but I'm still not convinced it's necessary if we already have a way to do this that works 😆

Comment thread pre_commit/clientlib.py
Comment thread pre_commit/clientlib.py
@s0undt3ch

Copy link
Copy Markdown
Contributor Author

I reviewed this, it's simple enough, but I'm still not convinced it's necessary if we already have a way to do this that works

We'll, we don't really support this, unless you call it twice, with different config file as you suggested on the issue filed.

Plus, it's a really simple change :)

I'll address your other review comments and update the PR accordingly.

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

Updated. Is this more what you had in mind?

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

hmm, if I follow your suggestion, then tests like test_does_not_reformat fail, because, now, there's a alias key which defaults to the ID. :\

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

Polite ping.

Yeah, I know it's the holidays and it can surely wait until next year :)

@asottile asottile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SKIP is not handled properly, it's also unclear the "right" way SKIP should be handled -- should it exclude both the things?

Comment thread pre_commit/commands/run.py Outdated
Comment thread pre_commit/commands/run.py Outdated
@asottile

Copy link
Copy Markdown
Member

I didn't review because the tests are failing :P

@s0undt3ch

s0undt3ch commented Dec 26, 2018

Copy link
Copy Markdown
Contributor Author

SKIP is not handled properly, it's also unclear the "right" way SKIP should be handled -- should it exclude both the things?

It only makes sense for pre-commit to also skip based on a hook alias. Added support and test.

Comment thread pre_commit/commands/run.py Outdated
Comment thread tests/commands/run_test.py Outdated
Comment thread pre_commit/commands/run.py Outdated
@asottile
asottile merged commit 8c550d0 into pre-commit:master Dec 27, 2018
@s0undt3ch
s0undt3ch deleted the features/repo-alias branch December 27, 2018 20:17
@s0undt3ch

Copy link
Copy Markdown
Contributor Author

Thanks!!!

@asottile

Copy link
Copy Markdown
Member

thanks @s0undt3ch for bearing with me 🎉

could you please add this information to the documentation? It'll land in the next minor release so you can use _new in 1.14.0_

The docs live at https://github.com/pre-commit/pre-commit.github.io

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

No problem. pre-commit/pre-commit.com#196

@s0undt3ch

Copy link
Copy Markdown
Contributor Author

Got a timeframe for 1.14.0?

@asottile

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants