Skip to content

Commit

Permalink
Merge pull request #59 from homebysix/1.12.3
Browse files Browse the repository at this point in the history
v1.12.3 merge to main
  • Loading branch information
homebysix authored Apr 10, 2022
2 parents 11e78a6 + c4c50c4 commit 04225b3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ All notable changes to this project will be documented in this file. This projec

Nothing yet.

## [1.12.3] - 2022-04-09

### Changed

- 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`.

### Fixed

- Resolved an uncaught exception if the git config email is unset. (#58)

## [1.12.2] - 2022-02-27

### Changed
Expand Down Expand Up @@ -283,7 +293,8 @@ Nothing yet.

- Initial release

[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.2...HEAD
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.3...HEAD
[1.12.3]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.2...v1.12.3
[1.12.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.1...v1.12.2
[1.12.1]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.12.0...v1.12.1
[1.12.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.11.0...v1.12.0
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For any hook in this repo you wish to use, add the following to your pre-commit

```yaml
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.12.2
rev: v1.12.3
hooks:
- id: check-plists
# - id: ...
Expand Down Expand Up @@ -121,7 +121,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat

```yaml
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.12.2
rev: v1.12.3
hooks:
- id: check-munki-pkgsinfo
args: ['--catalogs', 'testing', 'stable', '--']
Expand All @@ -131,7 +131,7 @@ But if you also use the `--categories` argument, you would move the trailing `--

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

```yaml
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.12.2
rev: v1.12.3
hooks:
- id: check-munki-pkgsinfo
args: [
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Releasing new versions of pre-commit-macadmin

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

1. Update the change log.

Expand Down
18 changes: 15 additions & 3 deletions pre_commit_hooks/check_git_config_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,21 @@ def main(argv=None):

retval = 0
if args.domains:
user_email = subprocess.check_output(["git", "config", "--get", "user.email"])
user_email = user_email.decode().strip()
if not any((user_email.endswith(x) for x in args.domains)):
proc = subprocess.run(
["git", "config", "--get", "user.email"],
check=False,
capture_output=True,
text=True,
)
user_email = proc.stdout.strip()
if not user_email:
print("Git config email is not set.")
retval = 1
elif "@" not in user_email:
print("Git config email does not look like an email address.")
print("Git config email: " + user_email)
retval = 1
elif not any((user_email.endswith("@" + x) for x in args.domains)):
print("Git config email is from an unexpected domain.")
print("Git config email: " + user_email)
print("Expected domains: " + str(args.domains))
Expand Down
3 changes: 1 addition & 2 deletions pre_commit_hooks/check_munki_pkgsinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ def main(argv=None):
)
):
print(
"{}: contains a pkg installer but has no blocking applications".format(
"WARNING: {}: contains a pkg installer but has no blocking applications".format(
filename
)
)
retval = 1

# Ensure an icon exists for the item.
if not any(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name="pre-commit-macadmin",
description="Pre-commit hooks for Mac admins, client engineers, and IT consultants.",
url="https://github.com/homebysix/pre-commit-macadmin",
version="1.12.2",
version="1.12.3",
author="Elliot Jordan",
author_email="[email protected]",
packages=["pre_commit_hooks"],
Expand Down

0 comments on commit 04225b3

Please sign in to comment.