@@ -105,14 +105,13 @@ def validate_comments(filename, strict):
105105 if "<!--" in recipe_text and "-->" in recipe_text :
106106 if strict :
107107 print (
108- "{}: Convert from <!-- --> style comments "
109- "to a Comment key." .format (filename )
108+ f"{ filename } : Convert from <!-- --> style comments to a Comment key."
110109 )
111110 passed = False
112111 else :
113112 print (
114- "{ }: WARNING: Recommend converting from <!-- --> style comments "
115- "to a Comment key." . format ( filename )
113+ f" { filename } : WARNING: Recommend converting from <!-- --> style comments "
114+ "to a Comment key."
116115 )
117116
118117 return passed
@@ -126,9 +125,7 @@ def validate_processor_keys(process, filename):
126125 if missing_processor_keys :
127126 for missing_proc in missing_processor_keys :
128127 print (
129- '{}: Item in processor array is missing "Processor" key:\n {}' .format (
130- filename , missing_proc
131- )
128+ f'{ filename } : Item in processor array is missing "Processor" key:\n { missing_proc } '
132129 )
133130 passed = False
134131
@@ -159,14 +156,12 @@ def validate_endofcheckphase(process, filename):
159156 )
160157 if endofcheck_idx is None :
161158 print (
162- "{}: Contains a download processor, but no EndOfCheckPhase "
163- "processor." .format (filename )
159+ f"{ filename } : Contains a download processor, but no EndOfCheckPhase processor."
164160 )
165161 passed = False
166162 elif endofcheck_idx < downloader_idx :
167163 print (
168- "{}: EndOfCheckPhase typically goes after a download processor, "
169- "not before." .format (filename )
164+ f"{ filename } : EndOfCheckPhase typically goes after a download processor, not before."
170165 )
171166 passed = False
172167
@@ -223,8 +218,7 @@ def validate_minimumversion(process, min_vers, ignore_min_vers_before, filename)
223218 if proc in [x .get ("Processor" ) for x in process ]:
224219 if Version (min_vers ) < Version (proc_min_versions [proc ]):
225220 print (
226- "{}: {} processor requires minimum AutoPkg "
227- "version {}" .format (filename , proc , proc_min_versions [proc ])
221+ f"{ filename } : { proc } processor requires minimum AutoPkg version { proc_min_versions [proc ]} "
228222 )
229223 passed = False
230224
@@ -241,8 +235,7 @@ def validate_no_deprecated_procs(process, filename):
241235 for proc in process :
242236 if proc .get ("Processor" ) in deprecated_procs :
243237 print (
244- "{}: WARNING: Deprecated processor {} "
245- "is used." .format (filename , proc .get ("Processor" ))
238+ f'{ filename } : WARNING: Deprecated processor { proc .get ("Processor" )} is used.'
246239 )
247240
248241 return passed
@@ -259,10 +252,8 @@ def validate_no_superclass_procs(process, filename):
259252 for proc in process :
260253 if proc .get ("Processor" ) in superclass_procs :
261254 print (
262- "{}: WARNING: The processor {} is intended to be used "
263- "by other processors, not used directly in recipes." .format (
264- filename , proc .get ("Processor" )
265- )
255+ f"{ filename } : WARNING: The processor { proc .get ('Processor' )} is intended to be used "
256+ "by other processors, not used directly in recipes."
266257 )
267258
268259 return passed
@@ -324,9 +315,7 @@ def validate_jamf_processor_order(process, filename):
324315# subst = "%" + input_var + "%"
325316# if subst not in recipe_text:
326317# print(
327- # "{}: WARNING: Input variable {} not referenced in recipe.".format(
328- # filename, input_var
329- # )
318+ # f"{filename}: WARNING: Input variable {input_var} not referenced in recipe."
330319# )
331320
332321# return passed
@@ -353,8 +342,8 @@ def validate_no_var_in_app_path(process, filename):
353342 for _ , argvalue in proc ["Arguments" ].items ():
354343 if isinstance (argvalue , str ) and "%NAME%.app" in argvalue :
355344 print (
356- "{ }: Use actual app name instead of %NAME%.app in {} "
357- "processor argument." . format ( filename , proc . get ( "Processor" ))
345+ f" { filename } : Use actual app name instead of %NAME%.app in { proc . get ( 'Processor' ) } "
346+ "processor argument."
358347 )
359348 passed = False
360349
@@ -405,13 +394,13 @@ def validate_proc_type_conventions(process, filename):
405394 passed = True
406395 processors = [x .get ("Processor" ) for x in process ]
407396 for recipe_type in proc_type_conventions :
408- type_hint = ".{}." . format ( recipe_type )
397+ type_hint = f ".{ recipe_type } ."
409398 if type_hint not in filename :
410399 for processor in processors :
411400 if processor in proc_type_conventions [recipe_type ]:
412401 print (
413- "{ }: Processor {} is not conventional for this "
414- "recipe type." . format ( filename , processor )
402+ f" { filename } : Processor { processor } is not conventional for this "
403+ "recipe type."
415404 )
416405 passed = False
417406
@@ -445,7 +434,7 @@ def validate_required_proc_for_types(process, filename):
445434 processors = [x .get ("Processor" ) for x in process ]
446435 for recipe_type in required_proc_for_type :
447436 req_procs = required_proc_for_type [recipe_type ]
448- type_hint = ".{}." . format ( recipe_type )
437+ type_hint = f ".{ recipe_type } ."
449438 if type_hint in filename :
450439 if recipe_type == "pkg" and processors == []:
451440 # OK for pkg recipes to have an empty process list, as long as
@@ -455,13 +444,13 @@ def validate_required_proc_for_types(process, filename):
455444 if not any ([x in processors for x in req_procs ]):
456445 if len (req_procs ) == 1 :
457446 print (
458- "{ }: Recipe type {} should contain processor "
459- "{}." . format ( filename , recipe_type , req_procs [0 ])
447+ f" { filename } : Recipe type { recipe_type } should contain processor "
448+ f" { req_procs [0 ]} ."
460449 )
461450 else :
462451 print (
463- "{ }: Recipe type {} should contain one of these "
464- "processors: {}." . format ( filename , recipe_type , req_procs )
452+ f" { filename } : Recipe type { recipe_type } should contain one of these "
453+ f "processors: { req_procs } ."
465454 )
466455 passed = False
467456
@@ -495,23 +484,14 @@ def validate_proc_args(process, filename):
495484
496485 if not core_procs [proc ["Processor" ]]:
497486 print (
498- "{}: Unknown argument {} for processor {}, "
499- "which does not accept any arguments." .format (
500- filename ,
501- arg ,
502- proc ["Processor" ],
503- )
487+ f"{ filename } : Unknown argument { arg } for processor { proc ['Processor' ]} , "
488+ "which does not accept any arguments."
504489 )
505490 passed = False
506491 elif arg not in core_procs [proc ["Processor" ]]:
507492 print (
508- "{}: Unknown argument {} for processor {}. "
509- "Allowed arguments are: {}" .format (
510- filename ,
511- arg ,
512- proc ["Processor" ],
513- ", " .join (core_procs [proc ["Processor" ]]),
514- )
493+ f"{ filename } : Unknown argument { arg } for processor { proc ['Processor' ]} . Allowed arguments are: "
494+ + ", " .join (core_procs [proc ["Processor" ]])
515495 )
516496 passed = False
517497
@@ -550,9 +530,7 @@ def main(argv=None):
550530 # Ensure the recipe identifier isn't duplicated.
551531 if recipe ["Identifier" ] in seen_identifiers :
552532 print (
553- '{}: Identifier "{}" is shared by another recipe in this repo.' .format (
554- filename , recipe ["Identifier" ]
555- )
533+ f'{ filename } : Identifier "{ recipe ["Identifier" ]} " is shared by another recipe in this repo.'
556534 )
557535 retval = 1
558536 else :
@@ -566,10 +544,7 @@ def main(argv=None):
566544 if not validate_recipe_prefix (recipe , filename , args .recipe_prefix ):
567545 retval = 1
568546 if recipe ["Identifier" ] == recipe .get ("ParentRecipe" ):
569- print (
570- "{}: Identifier and ParentRecipe should not "
571- "be the same." .format (filename )
572- )
547+ print (f"{ filename } : Identifier and ParentRecipe should not be the same." )
573548 retval = 1
574549
575550 # Validate that all input variables are used.
@@ -601,9 +576,7 @@ def main(argv=None):
601576 for os_vers_key in os_vers_corrections :
602577 if os_vers_key in input_key ["pkginfo" ]:
603578 print (
604- "{}: You used {} when you probably meant {}." .format (
605- filename , os_vers_key , os_vers_corrections [os_vers_key ]
606- )
579+ f"{ filename } : You used { os_vers_key } when you probably meant { os_vers_corrections [os_vers_key ]} ."
607580 )
608581 retval = 1
609582
0 commit comments