From 137d757a8b0e374f1bdbfbad01cf622bb8cc482b Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Thu, 13 Jun 2024 16:49:49 +0200 Subject: [PATCH] Reduce complexity of `ComponentTemplater._initialize_from_cookiecutter_args()` --- commodore/component/template.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/commodore/component/template.py b/commodore/component/template.py index ca053493..70e401d1 100644 --- a/commodore/component/template.py +++ b/commodore/component/template.py @@ -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", "" ) @@ -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