Skip to content

Commit 0689f63

Browse files
authored
Merge pull request #41 from homebysix/1.8.0
v1.8.0 merge to master
2 parents d6b3af5 + ed20a40 commit 0689f63

11 files changed

Lines changed: 33 additions & 17 deletions

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
44

55

6+
## [1.8.0] - 2020-10-08
7+
8+
### Changed
9+
- Replaced `plistlib.readPlist()` with `plistlib.load()`
10+
11+
612
## [1.7.0] - 2020-10-06
713

814
### Added
@@ -188,8 +194,9 @@ All notable changes to this project will be documented in this file. This projec
188194
- Initial release
189195

190196

191-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.7.0...HEAD
192-
[1.6.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.6.2...v1.7.0
197+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.8.0...HEAD
198+
[1.8.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.7.0...v1.8.0
199+
[1.7.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.6.2...v1.7.0
193200
[1.6.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.6.1...v1.6.2
194201
[1.6.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.6.0...v1.6.1
195202
[1.6.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.5.2...v1.6.0

README.md

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

1414
```yaml
1515
- repo: https://github.com/homebysix/pre-commit-macadmin
16-
rev: v1.7.0
16+
rev: v1.8.0
1717
hooks:
1818
- id: check-plists
1919
# - id: ...
@@ -119,7 +119,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat
119119

120120
```yaml
121121
- repo: https://github.com/homebysix/pre-commit-macadmin
122-
rev: v1.7.0
122+
rev: v1.8.0
123123
hooks:
124124
- id: check-munki-pkgsinfo
125125
args: ['--catalogs', 'testing', 'stable', '--']
@@ -129,7 +129,7 @@ But if you also use the `--categories` argument, you would move the trailing `--
129129

130130
```yaml
131131
- repo: https://github.com/homebysix/pre-commit-macadmin
132-
rev: v1.7.0
132+
rev: v1.8.0
133133
hooks:
134134
- id: check-munki-pkgsinfo
135135
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
@@ -141,7 +141,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu
141141

142142
```yaml
143143
- repo: https://github.com/homebysix/pre-commit-macadmin
144-
rev: v1.7.0
144+
rev: v1.8.0
145145
hooks:
146146
- id: check-munki-pkgsinfo
147147
args: [

pre_commit_hooks/check_autopkg_recipe_list.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"""
88

99
import argparse
10+
import json
1011
import plistlib
1112
from xml.parsers.expat import ExpatError
12-
import json
13+
1314
import ruamel.yaml
1415

1516
yaml = ruamel.yaml.YAML(typ="safe")
@@ -44,7 +45,8 @@ def main(argv=None):
4445
]
4546
elif filename.endswith(".plist"):
4647
try:
47-
recipe_list = plistlib.readPlist(filename)
48+
with open(filename, "rb") as openfile:
49+
recipe_list = plistlib.load(openfile)
4850
except (ExpatError, ValueError) as err:
4951
print("{}: plist parsing error: {}".format(filename, err))
5052
retval = 1

pre_commit_hooks/check_autopkg_recipes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ def main(argv=None):
383383
retval = 0
384384
for filename in args.filenames:
385385
try:
386-
recipe = plistlib.readPlist(filename)
386+
with open(filename, "rb") as openfile:
387+
recipe = plistlib.load(openfile)
387388

388389
except (ExpatError, ValueError) as err:
389390
print("{}: plist parsing error: {}".format(filename, err))

pre_commit_hooks/check_jamf_profiles.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def main(argv=None):
2727
retval = 0
2828
for filename in args.filenames:
2929
try:
30-
profile = plistlib.readPlist(filename)
30+
with open(filename, "rb") as openfile:
31+
profile = plistlib.load(openfile)
3132
except (ExpatError, ValueError) as err:
3233
print("{}: plist parsing error: {}".format(filename, err))
3334
retval = 1

pre_commit_hooks/check_munki_pkgsinfo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def main(argv=None):
4949
retval = 0
5050
for filename in args.filenames:
5151
try:
52-
pkginfo = plistlib.readPlist(filename)
52+
with open(filename, "rb") as openfile:
53+
pkginfo = plistlib.load(openfile)
5354
except (ExpatError, ValueError) as err:
5455
print("{}: plist parsing error: {}".format(filename, err))
5556
retval = 1
@@ -180,7 +181,7 @@ def main(argv=None):
180181
if script_type in pkginfo:
181182
if all(not pkginfo[script_type].startswith(x + "\n") for x in shebangs):
182183
print(
183-
"{}: has a {} that does not start with a valid shebang.".format(
184+
"{}: Has a {} that does not start with a valid shebang.".format(
184185
filename, script_type
185186
)
186187
)

pre_commit_hooks/check_munkipkg_buildinfo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def main(argv=None):
8181
for filename in args.filenames:
8282
if filename.endswith(".plist"):
8383
try:
84-
buildinfo = plistlib.readPlist(filename)
84+
with open(filename, "rb") as openfile:
85+
buildinfo = plistlib.load(openfile)
8586
except (ExpatError, ValueError) as err:
8687
print("{}: plist parsing error: {}".format(filename, err))
8788
retval = 1

pre_commit_hooks/check_plists.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def main(argv=None):
2727
retval = 0
2828
for filename in args.filenames:
2929
try:
30-
plist = plistlib.readPlist(filename)
30+
with open(filename, "rb") as openfile:
31+
plist = plistlib.load(openfile)
3132
# Possible future addition, but disabled for now.
3233
# if not isinstance(plist, dict):
3334
# print("{}: top level of plist should be type dict".format(filename))

pre_commit_hooks/forbid_autopkg_overrides.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def main(argv=None):
3030
retval = 0
3131
for filename in args.filenames:
3232
try:
33-
recipe = plistlib.readPlist(filename)
33+
with open(filename, "rb") as openfile:
34+
recipe = plistlib.load(openfile)
3435
for req_key in required_keys:
3536
if req_key not in recipe:
3637
print("{}: possible AutoPkg recipe override".format(filename))

pre_commit_hooks/forbid_autopkg_trust_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def main(argv=None):
2828
retval = 0
2929
for filename in args.filenames:
3030
try:
31-
recipe = plistlib.readPlist(filename)
31+
with open(filename, "rb") as openfile:
32+
recipe = plistlib.load(openfile)
3233
if "ParentRecipeTrustInfo" in recipe:
3334
print("{}: trust info in recipe".format(filename))
3435
retval = 1

0 commit comments

Comments
 (0)