Skip to content

Commit c31c420

Browse files
committed
Fix style and linter issues
1 parent e88781c commit c31c420

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

linter_exclusions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,3 +3522,9 @@ confcom containers from_image:
35223522
image:
35233523
rule_exclusions:
35243524
- no_positional_parameters
3525+
3526+
confcom fragment references from_image:
3527+
parameters:
3528+
image:
3529+
rule_exclusions:
3530+
- no_positional_parameters

src/confcom/azext_confcom/_help.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,28 @@
346346
- name: Input an image reference and generate container definitions
347347
text: az confcom containers from_image my.azurecr.io/myimage:tag
348348
"""
349+
350+
helps[
351+
"confcom fragment references"
352+
] = """
353+
type: group
354+
short-summary: Commands which generate Security Policy Fragment References.
355+
"""
356+
357+
358+
helps[
359+
"confcom fragment references from_image"
360+
] = """
361+
type: command
362+
short-summary: Create a Security Policy Fragment Reference based on an image reference.
363+
364+
parameters:
365+
- name: --minimum-svn
366+
type: str
367+
short-summary: 'The value of the minimum SVN field in the generated fragment reference, defaults to current fragment reference'
368+
369+
370+
examples:
371+
- name: Input an image reference and generate fragment reference
372+
text: az confcom fragment references from_image my.azurecr.io/myimage:tag
373+
"""

src/confcom/azext_confcom/lib/images.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,5 @@ def get_image_config(image: str) -> dict:
6666

6767

6868
def sanitize_image_reference(image_reference: str) -> str:
69-
return re.sub(f"[{re.escape(r'<>:"/\\|?*@\0')}]", "-", image_reference)
69+
illegal = r'<>:"/\\|?*@\0'
70+
return re.sub(f"[{re.escape(illegal)}]", "-", image_reference)

0 commit comments

Comments
 (0)