Skip to content

Commit 85298dc

Browse files
committed
Add VariablePlaceholder suggestion
1 parent 55b23e7 commit 85298dc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. This projec
2020

2121
- Include `SignToolVerifier` and `URLDownloaderPython` AutoPkg processors when suggesting minimum versions.
2222
- Updated AutoPkg recipe type convention checking to include new `JamfUpload` processors as well as `URLDownloaderPython` and `MunkiInfoCreator`.
23+
- Added a suggestion to use Rich Trouton's [VariablePlaceholder](https://derflounder.wordpress.com/2024/08/16/setting-custom-variables-in-autopkg-using-the-variableplaceholder-processor/) processor for setting arbitrary environment variables instead of supplying unexpected arguments to existing processors.
2324

2425
### Fixed
2526

pre_commit_hooks/check_autopkg_recipes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,17 +521,23 @@ def validate_proc_args(process, filename):
521521
# Skip args in ignored list above.
522522
continue
523523

524+
suggestion = (
525+
"Consider using the VariablePlaceholder processor for adding custom environment variables:\n"
526+
"https://derflounder.wordpress.com/2024/08/16/setting-custom-variables-in-autopkg-using-the-variableplaceholder-processor/"
527+
)
524528
if not core_procs[proc["Processor"]]:
525529
print(
526530
f"{filename}: Unknown argument {arg} for processor {proc['Processor']}, "
527531
"which does not accept any arguments."
528532
)
533+
print(suggestion)
529534
passed = False
530535
elif arg not in core_procs[proc["Processor"]]:
531536
print(
532537
f"{filename}: Unknown argument {arg} for processor {proc['Processor']}. Allowed arguments are: "
533538
+ ", ".join(core_procs[proc["Processor"]])
534539
)
540+
print(suggestion)
535541
passed = False
536542

537543
return passed

0 commit comments

Comments
 (0)