Skip to content

Commit 518108e

Browse files
authored
Merge pull request #98 from homebysix/dev
1.21.1 merge to main
2 parents 27b745e + 9ccd73f commit 518108e

File tree

4 files changed

+49
-45
lines changed

4 files changed

+49
-45
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ All notable changes to this project will be documented in this file. This projec
1414

1515
Nothing yet.
1616

17+
## [1.21.1] - 2025-10-26
18+
19+
### Fixed
20+
21+
- Fixed bug in `check-autopkg-recipes` that would flag processors as "not conventional" for recipe types that have multiple filename hints. Realistically, this only affected `.jamf` or `.jamf-upload` recipe types.
22+
1723
## [1.21.0] - 2025-09-21
1824

1925
### Added

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For any hook in this repo you wish to use, add the following to your pre-commit
1515

1616
```yaml
1717
- repo: https://github.com/homebysix/pre-commit-macadmin
18-
rev: v1.21.0
18+
rev: v1.21.1
1919
hooks:
2020
- id: check-plists
2121
# - id: ...
@@ -147,7 +147,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat
147147

148148
```yaml
149149
- repo: https://github.com/homebysix/pre-commit-macadmin
150-
rev: v1.21.0
150+
rev: v1.21.1
151151
hooks:
152152
- id: check-munki-pkgsinfo
153153
args: ['--catalogs', 'testing', 'stable', '--']
@@ -157,7 +157,7 @@ But if you also use the `--categories` argument, you would move the trailing `--
157157

158158
```yaml
159159
- repo: https://github.com/homebysix/pre-commit-macadmin
160-
rev: v1.21.0
160+
rev: v1.21.1
161161
hooks:
162162
- id: check-munki-pkgsinfo
163163
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
@@ -169,7 +169,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu
169169

170170
```yaml
171171
- repo: https://github.com/homebysix/pre-commit-macadmin
172-
rev: v1.21.0
172+
rev: v1.21.1
173173
hooks:
174174
- id: check-munki-pkgsinfo
175175
args: [

pre_commit_macadmin_hooks/check_autopkg_recipes.py

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -391,44 +391,17 @@ def validate_proc_type_conventions(process, filename):
391391

392392
# For each processor type, this is the list of processors that
393393
# we only expect to see in that type. List order is unimportant.
394-
# TODO: Simpler to check for `com.github.grahampugh.jamf-upload.processors/` prefix?
395-
jamf_upload_procs = [
396-
"com.github.grahampugh.jamf-upload.processors/JamfAccountUploader",
397-
"com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader",
398-
"com.github.grahampugh.jamf-upload.processors/JamfClassicAPIObjectUploader",
399-
"com.github.grahampugh.jamf-upload.processors/JamfComputerGroupDeleter",
400-
"com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader",
401-
"com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader",
402-
"com.github.grahampugh.jamf-upload.processors/JamfDockItemUploader",
403-
"com.github.grahampugh.jamf-upload.processors/JamfExtensionAttributeUploader",
404-
"com.github.grahampugh.jamf-upload.processors/JamfIconUploader",
405-
"com.github.grahampugh.jamf-upload.processors/JamfMacAppUploader",
406-
"com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceGroupUploader",
407-
"com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceProfileUploader",
408-
"com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner",
409-
"com.github.grahampugh.jamf-upload.processors/JamfPackageRecalculator",
410-
"com.github.grahampugh.jamf-upload.processors/JamfPackageUploader",
411-
"com.github.grahampugh.jamf-upload.processors/JamfPatchChecker",
412-
"com.github.grahampugh.jamf-upload.processors/JamfPatchUploader",
413-
"com.github.grahampugh.jamf-upload.processors/JamfPkgMetadataUploader",
414-
"com.github.grahampugh.jamf-upload.processors/JamfPolicyDeleter",
415-
"com.github.grahampugh.jamf-upload.processors/JamfPolicyLogFlusher",
416-
"com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader",
417-
"com.github.grahampugh.jamf-upload.processors/JamfScriptUploader",
418-
"com.github.grahampugh.jamf-upload.processors/JamfSoftwareRestrictionUploader",
419-
"com.github.grahampugh.jamf-upload.processors/JamfUploaderSlacker",
420-
"com.github.grahampugh.jamf-upload.processors/JamfUploaderTeamsNotifier",
421-
]
422394
proc_type_conventions = {
423-
"download": [
395+
# Tuple contains all recipe types that share these conventions.
396+
("download",): [
424397
"SparkleUpdateInfoProvider",
425398
"GitHubReleasesInfoProvider",
426399
"URLDownloader",
427400
"URLDownloaderPython",
428401
"CURLDownloader",
429402
"EndOfCheckPhase",
430403
],
431-
"munki": [
404+
("munki",): [
432405
"MunkiInfoCreator",
433406
"MunkiInstallsItemsCreator",
434407
"MunkiPkginfoMerger",
@@ -437,15 +410,40 @@ def validate_proc_type_conventions(process, filename):
437410
"MunkiOptionalReceiptEditor",
438411
"MunkiImporter",
439412
],
440-
"pkg": ["AppPkgCreator", "PkgCreator"],
441-
"install": ["InstallFromDMG", "Installer"],
413+
("pkg",): ["AppPkgCreator", "PkgCreator"],
414+
("install",): ["InstallFromDMG", "Installer"],
442415
# https://github.com/jssimporter/JSSImporter
443-
"jss": ["JSSImporter"],
416+
("jss",): ["JSSImporter"],
444417
# https://github.com/grahampugh/jamf-upload
445-
"jamf": jamf_upload_procs,
446-
"jamf-upload": jamf_upload_procs,
418+
("jamf", "jamf-upload"): [
419+
"com.github.grahampugh.jamf-upload.processors/JamfAccountUploader",
420+
"com.github.grahampugh.jamf-upload.processors/JamfCategoryUploader",
421+
"com.github.grahampugh.jamf-upload.processors/JamfClassicAPIObjectUploader",
422+
"com.github.grahampugh.jamf-upload.processors/JamfComputerGroupDeleter",
423+
"com.github.grahampugh.jamf-upload.processors/JamfComputerGroupUploader",
424+
"com.github.grahampugh.jamf-upload.processors/JamfComputerProfileUploader",
425+
"com.github.grahampugh.jamf-upload.processors/JamfDockItemUploader",
426+
"com.github.grahampugh.jamf-upload.processors/JamfExtensionAttributeUploader",
427+
"com.github.grahampugh.jamf-upload.processors/JamfIconUploader",
428+
"com.github.grahampugh.jamf-upload.processors/JamfMacAppUploader",
429+
"com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceGroupUploader",
430+
"com.github.grahampugh.jamf-upload.processors/JamfMobileDeviceProfileUploader",
431+
"com.github.grahampugh.jamf-upload.processors/JamfPackageCleaner",
432+
"com.github.grahampugh.jamf-upload.processors/JamfPackageRecalculator",
433+
"com.github.grahampugh.jamf-upload.processors/JamfPackageUploader",
434+
"com.github.grahampugh.jamf-upload.processors/JamfPatchChecker",
435+
"com.github.grahampugh.jamf-upload.processors/JamfPatchUploader",
436+
"com.github.grahampugh.jamf-upload.processors/JamfPkgMetadataUploader",
437+
"com.github.grahampugh.jamf-upload.processors/JamfPolicyDeleter",
438+
"com.github.grahampugh.jamf-upload.processors/JamfPolicyLogFlusher",
439+
"com.github.grahampugh.jamf-upload.processors/JamfPolicyUploader",
440+
"com.github.grahampugh.jamf-upload.processors/JamfScriptUploader",
441+
"com.github.grahampugh.jamf-upload.processors/JamfSoftwareRestrictionUploader",
442+
"com.github.grahampugh.jamf-upload.processors/JamfUploaderSlacker",
443+
"com.github.grahampugh.jamf-upload.processors/JamfUploaderTeamsNotifier",
444+
],
447445
# https://github.com/autopkg/filewave
448-
"filewave": [
446+
("filewave",): [
449447
"com.github.autopkg.filewave.FWTool/FileWaveImporter",
450448
"com.github.johncclayton.filewave.FWTool/FileWaveImporter",
451449
"com.github.autopkg.filewave.FWTool/FWTool",
@@ -454,11 +452,11 @@ def validate_proc_type_conventions(process, filename):
454452

455453
passed = True
456454
processors = [x.get("Processor") for x in process]
457-
for recipe_type in proc_type_conventions:
458-
type_hint = f".{recipe_type}."
459-
if type_hint not in filename:
455+
for recipe_group in proc_type_conventions:
456+
type_hints = [f".{recipe_type}." for recipe_type in recipe_group]
457+
if not any(th in filename for th in type_hints):
460458
for processor in processors:
461-
if processor in proc_type_conventions[recipe_type]:
459+
if processor in proc_type_conventions[recipe_group]:
462460
print(
463461
f"{filename}: Processor {processor} is not conventional for this "
464462
"recipe type."

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name="pre-commit-macadmin",
77
description="Pre-commit hooks for Mac admins, client engineers, and IT consultants.",
88
url="https://github.com/homebysix/pre-commit-macadmin",
9-
version="1.21.0",
9+
version="1.21.1",
1010
author="Elliot Jordan",
1111
author_email="[email protected]",
1212
packages=["pre_commit_macadmin_hooks"],

0 commit comments

Comments
 (0)