@@ -107,11 +107,7 @@ def replace_in_kustomization(content: str, new_tag: str) -> Tuple[str, int]:
107107
108108 if in_images_block :
109109 current_indent = len (line ) - len (line .lstrip (" \t " ))
110- if (
111- images_indent is not None
112- and current_indent <= images_indent
113- and line .strip ()
114- ):
110+ if images_indent is not None and current_indent <= images_indent and line .strip ():
115111 # Left the images block
116112 in_images_block = False
117113 images_indent = None
@@ -133,9 +129,7 @@ def replace_in_readme(content: str, new_tag: str) -> Tuple[str, int]:
133129 - ghcr.io/jeboehm/<name>:latest
134130 - docker.io/jeboehm/<name>:latest
135131 """
136- pattern = re .compile (
137- r"(?P<name>\b(?:(?:ghcr|docker)\.io/)?jeboehm/[\w\-\.]+):latest\b"
138- )
132+ pattern = re .compile (r"(?P<name>\b(?:(?:ghcr|docker)\.io/)?jeboehm/[\w\-\.]+):latest\b" )
139133 new_content , count = pattern .subn (lambda m : f"{ m .group ('name' )} :{ new_tag } " , content )
140134 return new_content , count
141135
@@ -152,9 +146,7 @@ def main(argv: Sequence[str] | None = None) -> int:
152146 Returns:
153147 Exit code (0 for success)
154148 """
155- parser = argparse .ArgumentParser (
156- description = "Update :latest image tags to a specific version"
157- )
149+ parser = argparse .ArgumentParser (description = "Update :latest image tags to a specific version" )
158150 parser .add_argument ("new_tag" , help = "New tag to set (e.g., v1.2.3)" )
159151 parser .add_argument (
160152 "--dry-run" ,
@@ -175,9 +167,7 @@ def main(argv: Sequence[str] | None = None) -> int:
175167 replacements = 0
176168 new_content = original
177169
178- if path .name in {"docker-compose.yml" } or path .match (
179- "**/deploy/compose/*.yaml"
180- ):
170+ if path .name in {"docker-compose.yml" } or path .match ("**/deploy/compose/*.yaml" ):
181171 new_content , c = replace_in_compose_yaml (new_content , new_tag )
182172 replacements += c
183173
0 commit comments