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

added warning if globs are used instead of regex #1707

Merged
merged 1 commit into from Nov 23, 2020
Merged

added warning if globs are used instead of regex #1707

merged 1 commit into from Nov 23, 2020

Conversation

paulhfischer
Copy link
Contributor

@paulhfischer paulhfischer commented Nov 21, 2020

resolves #1702

@asottile
Copy link
Member

it probably makes more sense in pre_commit/clientlib.py? you can probably add a specific validator for this into the cfgv schema for the hook objects

@paulhfischer
Copy link
Contributor Author

thanks for the hint, i added a validator (+ test) topre_commit/clientlib.py that is applied on config hooks (CONFIG_HOOK_DICT). let me know if you think this is fine or if i should change something.

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.

looks great! just a few minor improvements

pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
tests/clientlib_test.py Outdated Show resolved Hide resolved
tests/clientlib_test.py Outdated Show resolved Hide resolved
@paulhfischer paulhfischer marked this pull request as ready for review November 22, 2020 19:27
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.

@asottile asottile merged commit 029f9cc into pre-commit:master Nov 23, 2020
@paulhfischer paulhfischer deleted the warn_on_globs_instead_of_regex branch November 23, 2020 20:05
@asottile
Copy link
Member

asottile commented Jan 1, 2021

@paulhfischer do you want to implement this for top-level files / exclude as well? I notice it's missing there :)

@paulhfischer
Copy link
Contributor Author

ah that's a good idea! i'll add it :)

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.

Add warning for files / exclude containing /*
2 participants