diff --git a/src/compwa_policy/check_dev_files/upgrade_lock.py b/src/compwa_policy/check_dev_files/upgrade_lock.py index a717dc0b..2dde61e9 100644 --- a/src/compwa_policy/check_dev_files/upgrade_lock.py +++ b/src/compwa_policy/check_dev_files/upgrade_lock.py @@ -113,13 +113,14 @@ def _update_precommit_schedule( if ci_section is None: return key = "autoupdate_schedule" - if key not in ci_section: - return if get_dependabot_ecosystems() & __TRIGGER_ECOSYSTEMS: - del ci_section[key] + frequency = "quarterly" + if ci_section.get(key) == frequency: + return + ci_section[key] = "quarterly" precommit.changelog.append( - "Deactivated pre-commit autoupdate schedule, because it is already" - f" triggered by the {CONFIG_PATH.github_workflow_dir / 'lock.yml'}." + "Set pre-commit autoupdate schedule to quarterly (maximum), because the" + " schedule is now determined by Dependabot" ) else: if frequency == "semiannually": diff --git a/src/compwa_policy/utilities/vscode.py b/src/compwa_policy/utilities/vscode.py index d828a819..34042cb9 100644 --- a/src/compwa_policy/utilities/vscode.py +++ b/src/compwa_policy/utilities/vscode.py @@ -127,7 +127,7 @@ def _determine_new_value(old: V, new: V, sort: bool = False) -> V: if isinstance(old, dict) and isinstance(new, dict): return _update_dict_recursively(old, new, sort) # ty:ignore[invalid-return-type] if isinstance(old, list) and isinstance(new, list): - return sorted({*old, *new}) # ty:ignore[invalid-argument-type] + return sorted({*old, *new}) # ty:ignore[invalid-return-type] return new