Skip to content

Commit 1132dcd

Browse files
authored
Merge pull request #52 from homebysix/2021-12-22
v1.12.1 merge to main
2 parents 485a0ca + 2699ef2 commit 1132dcd

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

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.12.0
18+
rev: v1.12.1
1919
hooks:
2020
- id: check-plists
2121
# - id: ...
@@ -121,7 +121,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat
121121

122122
```yaml
123123
- repo: https://github.com/homebysix/pre-commit-macadmin
124-
rev: v1.12.0
124+
rev: v1.12.1
125125
hooks:
126126
- id: check-munki-pkgsinfo
127127
args: ['--catalogs', 'testing', 'stable', '--']
@@ -131,7 +131,7 @@ But if you also use the `--categories` argument, you would move the trailing `--
131131

132132
```yaml
133133
- repo: https://github.com/homebysix/pre-commit-macadmin
134-
rev: v1.12.0
134+
rev: v1.12.1
135135
hooks:
136136
- id: check-munki-pkgsinfo
137137
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
@@ -143,7 +143,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu
143143

144144
```yaml
145145
- repo: https://github.com/homebysix/pre-commit-macadmin
146-
rev: v1.12.0
146+
rev: v1.12.1
147147
hooks:
148148
- id: check-munki-pkgsinfo
149149
args: [

pre_commit_hooks/check_preference_manifests.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def validate_required_keys(input_dict, required_keys, dict_name, filename):
4343
"""Verifies that required_keys are present in dictionary."""
4444
passed = True
4545
for req_key in required_keys:
46-
if not input_dict.get(req_key):
46+
if input_dict.get(req_key, "") == "":
4747
print("{}: {} missing required key {}".format(filename, dict_name, req_key))
4848
passed = False
4949
return passed
@@ -338,12 +338,12 @@ def validate_subkeys(subkeys, filename):
338338
if not validate_pfm_type_strings(subkey, filename):
339339
passed = False
340340

341-
# Check that list items are of the expected type
342-
if "pfm_type" not in subkey:
343-
print(
344-
"WARNING: Recommend adding a pfm_title to %s"
345-
% subkey.get("pfm_name", "<unnamed key>")
346-
)
341+
# TODO: Suggest adding a title if one is missing
342+
# if "pfm_title" not in subkey:
343+
# print(
344+
# "WARNING: Recommend adding a pfm_title to %s"
345+
# % subkey.get("pfm_name", "<unnamed key>")
346+
# )
347347

348348
# Check that list items are of the expected type
349349
if not validate_list_item_types(subkey, filename):
@@ -393,12 +393,13 @@ def main(argv=None):
393393
except (ExpatError, ValueError) as err:
394394
print("{}: plist parsing error: {}".format(filename, err))
395395
retval = 1
396+
continue # No need to continue checking this file
396397

397398
# Check for presence of required keys.
398399
required_keys = ("pfm_title", "pfm_domain", "pfm_description")
399400
if not validate_required_keys(manifest, required_keys, "<root dict>", filename):
400401
retval = 1
401-
break # No need to continue checking this file
402+
continue # No need to continue checking this file
402403

403404
# Ensure pfm_format_version has expected value
404405
if manifest.get("pfm_format_version", 1) != 1:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name="pre-commit-macadmin",
88
description="Pre-commit hooks for Mac admins, client engineers, and IT consultants.",
99
url="https://github.com/homebysix/pre-commit-macadmin",
10-
version="1.12.0",
10+
version="1.12.1",
1111
author="Elliot Jordan",
1212
author_email="elliot@elliotjordan.com",
1313
packages=["pre_commit_hooks"],

0 commit comments

Comments
 (0)