Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add types_or #1677
Add types_or #1677
Conversation
e5b7b12
to
b328a3e
|
good start! I believe check_hooks_apply and check_useless_excludes need to be updated |
| frozenset(types), | ||
| frozenset(types_or), | ||
| frozenset(exclude_types), | ||
| ) |
asottile
Nov 2, 2020
Member
this should be three separate lines
this should be three separate lines
| ret = [] | ||
| for filename in names: | ||
| tags = self._types_for_file(filename) | ||
| if tags >= types and not tags & exclude_types: | ||
| if tags >= types and not tags & exclude_types and tags & types_or: |
asottile
Nov 2, 2020
Member
teeny tiny thing, I'd order the conditions the same as the parameters
teeny tiny thing, I'd order the conditions the same as the parameters
| hook['types'], | ||
| hook['types_or'], | ||
| hook['exclude_types'], | ||
| ) |
asottile
Nov 2, 2020
Member
""
""
| entry: bin/hook.sh | ||
| language: script | ||
| types: [file] | ||
| types_or: [python, cython] |
asottile
Nov 2, 2020
Member
these are usually easier to demo with a local repo
I'd probably not write a full integration test for this feature as well but it looks like there maybe aren't great examples using the matcher
these are usually easier to demo with a local repo
I'd probably not write a full integration test for this feature as well but it looks like there maybe aren't great examples using the matcher
MarcoGorelli
Nov 2, 2020
Author
Contributor
Thanks for your feedback, but I'm not sure I understand - are there any existing tests I should look at as examples? If not, I'll try to figure this out, no worries
Thanks for your feedback, but I'm not sure I understand - are there any existing tests I should look at as examples? If not, I'll try to figure this out, no worries
| @@ -0,0 +1,3 @@ | |||
| #!/usr/bin/env bash | |||
| echo $@ | |||
asottile
Nov 2, 2020
Member
~technically this should be echo "$@"
~technically this should be echo "$@"
Thanks!
Sorry, this isn't clear to me - I updated |
oh maybe I'm wrong, maybe it already works |

closes #607