Skip to content

Commit 846e4ab

Browse files
committed
Enable warning upon encountering deprecated manifestkeys
1 parent b911345 commit 846e4ab

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

pre_commit_hooks/check_preference_manifests.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ def validate_pfm_type_strings(subkey, filename):
157157
"""Ensure subkey pfm_type strings are as expected."""
158158
passed = True
159159

160-
pfm_depr_types = (
161-
"union policy",
162-
"url",
163-
)
160+
pfm_depr_types = ("union policy", "url")
164161
if subkey["pfm_type"] in pfm_depr_types:
165-
# print('{}: Subkey type "{}" is deprecated'.format(filename, subkey["pfm_type"]))
162+
print(
163+
'{}: WARNING: Subkey type "{}" is deprecated'.format(
164+
filename, subkey["pfm_type"]
165+
)
166+
)
166167
# passed = False
167-
pass # DEBUG ONLY
168168
elif subkey["pfm_type"] not in PLIST_TYPES:
169169
print('{}: Unexpected subkey type "{}"'.format(filename, subkey["pfm_type"]))
170170
passed = False
@@ -266,13 +266,13 @@ def validate_pfm_default(subkey, filename):
266266
for test_key in ("pfm_default",):
267267
if test_key in subkey:
268268
if PLIST_TYPES[subkey["pfm_type"]] == list:
269-
desired_type = type(subkey["pfm_subkeys"][0])
270-
else:
271269
try:
272-
desired_type = PLIST_TYPES[subkey["pfm_type"]]
270+
desired_type = type(subkey["pfm_subkeys"][0])
273271
except IndexError:
274272
# Unknown desired type
275273
continue
274+
else:
275+
desired_type = PLIST_TYPES[subkey["pfm_type"]]
276276
if type(subkey[test_key]) != desired_type:
277277
print(
278278
"{}: {} value for {} should be {}, not {}".format(

0 commit comments

Comments
 (0)