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

Add regex matching to no-commit-to-branch hook #376

Merged
merged 6 commits into from
Apr 20, 2019
Merged

Add regex matching to no-commit-to-branch hook #376

merged 6 commits into from
Apr 20, 2019

Conversation

marcjay
Copy link
Contributor

@marcjay marcjay commented Apr 9, 2019

Add wildcard matching to no-commit-to-branch hook, so that commits can be blocked on, for example, all release branches with 'release/*'

Addresses: #375

be blocked on, for example, all release branches with 'release/*'
feedback. Adds --pattern optional argument which can be used alongside
--branch to block commits to a branch which matches a supplied
regex expression
@marcjay marcjay changed the title Add wildcard matching to no-commit-to-branch hook Add regex matching to no-commit-to-branch hook Apr 20, 2019
Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

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

otherwise looks great, thanks!

pre_commit_hooks/no_commit_to_branch.py Outdated Show resolved Hide resolved
mjay-taskize and others added 2 commits April 20, 2019 23:07
in no-commit-to-branch. Make other sets immutable to satisfy type-checking
and be consistent
@asottile
Copy link
Member

cool! I switched it to AbstractSet to appease mypy

@marcjay
Copy link
Contributor Author

marcjay commented Apr 20, 2019

Thanks! Appreciate the crash-course in mypy and cheers for fixing

@asottile asottile merged commit e6e26c3 into pre-commit:master Apr 20, 2019
@asottile
Copy link
Member

And thank you for the pull request 🎉

@marcjay marcjay deleted the no-commit-to-branch-wildcard branch April 21, 2019 20:29
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.

3 participants