Skip to content

Commit 04225b3

Browse files
authored
Merge pull request #59 from homebysix/1.12.3
v1.12.3 merge to main
2 parents 11e78a6 + c4c50c4 commit 04225b3

6 files changed

Lines changed: 34 additions & 12 deletions

File tree

CHANGELOG.md

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

1515
Nothing yet.
1616

17+
## [1.12.3] - 2022-04-09
18+
19+
### Changed
20+
21+
- Changed check-munki-pkgsinfo to WARN on the absence of the `blocking_applications` array for installers in pkg format, rather than to fail the pre-commit test. This better aligns with Munki's own design, which does not require `blocking_applications`.
22+
23+
### Fixed
24+
25+
- Resolved an uncaught exception if the git config email is unset. (#58)
26+
1727
## [1.12.2] - 2022-02-27
1828

1929
### Changed
@@ -283,7 +293,8 @@ Nothing yet.
283293

284294
- Initial release
285295

286-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.2...HEAD
296+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.3...HEAD
297+
[1.12.3]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.2...v1.12.3
287298
[1.12.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.1...v1.12.2
288299
[1.12.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.0...v1.12.1
289300
[1.12.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.11.0...v1.12.0

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.2
18+
rev: v1.12.3
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.2
124+
rev: v1.12.3
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.2
134+
rev: v1.12.3
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.2
146+
rev: v1.12.3
147147
hooks:
148148
- id: check-munki-pkgsinfo
149149
args: [

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Releasing new versions of pre-commit-macadmin
22

3-
1. Update the versions in __README.md__ and __pre_commit_hooks/\_\_init\_\_.py__.
3+
1. Update the versions in __README.md__ and __setup.py__.
44

55
1. Update the change log.
66

pre_commit_hooks/check_git_config_email.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,21 @@ def main(argv=None):
2929

3030
retval = 0
3131
if args.domains:
32-
user_email = subprocess.check_output(["git", "config", "--get", "user.email"])
33-
user_email = user_email.decode().strip()
34-
if not any((user_email.endswith(x) for x in args.domains)):
32+
proc = subprocess.run(
33+
["git", "config", "--get", "user.email"],
34+
check=False,
35+
capture_output=True,
36+
text=True,
37+
)
38+
user_email = proc.stdout.strip()
39+
if not user_email:
40+
print("Git config email is not set.")
41+
retval = 1
42+
elif "@" not in user_email:
43+
print("Git config email does not look like an email address.")
44+
print("Git config email: " + user_email)
45+
retval = 1
46+
elif not any((user_email.endswith("@" + x) for x in args.domains)):
3547
print("Git config email is from an unexpected domain.")
3648
print("Git config email: " + user_email)
3749
print("Expected domains: " + str(args.domains))

pre_commit_hooks/check_munki_pkgsinfo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,10 @@ def main(argv=None):
129129
)
130130
):
131131
print(
132-
"{}: contains a pkg installer but has no blocking applications".format(
132+
"WARNING: {}: contains a pkg installer but has no blocking applications".format(
133133
filename
134134
)
135135
)
136-
retval = 1
137136

138137
# Ensure an icon exists for the item.
139138
if not any(

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.2",
10+
version="1.12.3",
1111
author="Elliot Jordan",
1212
author_email="elliot@elliotjordan.com",
1313
packages=["pre_commit_hooks"],

0 commit comments

Comments
 (0)