Skip to content

Commit

Permalink
fix get property in pre-commit (#4238)
Browse files Browse the repository at this point in the history
* fix get property pre-commit

* changelog

* trailing space

---------

Co-authored-by: dorschw <[email protected]>
  • Loading branch information
ilaner and dorschw authored Apr 24, 2024
1 parent 951ba1c commit d6c4740
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changelog/4238.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: fixed an issue where reading **pre-commit** config templates would not handle cases with key=false and key:mode=true.
type: fix
pr_number: 4238
4 changes: 3 additions & 1 deletion demisto_sdk/commands/pre_commit/hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ def get_property(hook: dict, mode: str, name: str, default=None):
ret = None
if mode:
ret = hook.get(f"{name}:{mode}")
return ret or hook.get(name, default)
if ret is None:
return hook.get(name, default)
return ret

0 comments on commit d6c4740

Please sign in to comment.