6
6
from .logo import logo
7
7
8
8
9
- def link_asset_message (link_list : list , type : str , format : str ) -> None :
9
+ def link_asset_message (
10
+ link_list : list , type : str , format : str , healthy_msg : bool
11
+ ) -> None :
10
12
"""Prints a list of links or assets and any errors associated with them.
11
13
12
14
Args:
13
15
link_list (list): A list of links or assets.
14
16
type (str): The type of link or asset being processed.
15
17
format (str): The format or request being used.
18
+ healthy_msg (bool): Whether to display "No TYPE errors!" or not
16
19
17
20
Returns:
18
21
None.
@@ -21,7 +24,7 @@ def link_asset_message(link_list: list, type: str, format: str) -> None:
21
24
click .secho (f"{ type .upper ()} { format } errors: " , fg = "red" )
22
25
for asset in link_list :
23
26
click .secho (f" { asset } " )
24
- else :
27
+ elif healthy_msg :
25
28
click .secho (f"No { type .upper ()} { format } errors!" , fg = "green" )
26
29
27
30
@@ -130,19 +133,21 @@ def cli_message(linter: Linter) -> None:
130
133
131
134
if linter .invalid_asset_format is not None :
132
135
click .secho ()
133
- link_asset_message (linter .invalid_asset_format , "asset" , "format" )
136
+ link_asset_message (linter .invalid_asset_format , "asset" , "format" , True )
134
137
135
138
if linter .invalid_asset_request is not None :
136
139
click .secho ()
137
- link_asset_message (linter .invalid_asset_request , "asset" , "request" )
140
+ link_asset_message (
141
+ linter .invalid_asset_request , "asset" , "request" , linter .assets_open_urls
142
+ )
138
143
139
144
if linter .invalid_link_format is not None :
140
145
click .secho ()
141
- link_asset_message (linter .invalid_link_format , "link" , "format" )
146
+ link_asset_message (linter .invalid_link_format , "link" , "format" , True )
142
147
143
148
if linter .invalid_link_request is not None :
144
149
click .secho ()
145
- link_asset_message (linter .invalid_link_request , "link" , "request" )
150
+ link_asset_message (linter .invalid_link_request , "link" , "request" , True )
146
151
147
152
if linter .error_type != "" :
148
153
click .secho ("Validation error type: " , fg = "red" )
0 commit comments