Skip to content

Commit

Permalink
Reduce complexity of `ComponentTemplater._initialize_from_cookiecutte…
Browse files Browse the repository at this point in the history
…r_args()`
  • Loading branch information
simu committed Jun 14, 2024
1 parent 4ba195c commit 137d757
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions commodore/component/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def _initialize_from_cookiecutter_args(self, cookiecutter_args: dict[str, str]):
self.matrix_tests = cookiecutter_args["add_matrix"] == "y"
self.automerge_patch = cookiecutter_args["automerge_patch"] == "y"
self.automerge_patch_v0 = cookiecutter_args["automerge_patch_v0"] == "y"

self._initialize_automerge_pattern_lists_from_cookiecutter_args(
cookiecutter_args
)

return update_cruft_json

def _initialize_automerge_pattern_lists_from_cookiecutter_args(
self, cookiecutter_args: dict[str, str]
):
args_patch_blocklist = cookiecutter_args.get(
"automerge_patch_regexp_blocklist", ""
)
Expand All @@ -130,8 +140,6 @@ def _initialize_from_cookiecutter_args(self, cookiecutter_args: dict[str, str]):
else:
self._automerge_minor_allowlist = set()

return update_cruft_json

@property
def cookiecutter_args(self) -> dict[str, str]:
args = super().cookiecutter_args
Expand Down

0 comments on commit 137d757

Please sign in to comment.