Skip to content

Commit bd76f4a

Browse files
authored
Merge pull request #95 from homebysix/dev
1.21.0 merge to main
2 parents 92d8e26 + 8f01a69 commit bd76f4a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+235
-143
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
include = pre_commit_hooks/*
2+
include = pre_commit_macadmin_hooks/*
33

44
[report]
55
exclude_lines =

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ __pycache__/
1010
coverage.xml
1111
htmlcov/
1212

13+
# Package development
14+
*.egg-info/
15+
build/
16+
dist/
17+
1318
# Virtual environments
1419
.venv/
1520
venv/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-ast
6-
- id: check-byte-order-marker
76
- id: check-case-conflict
87
- id: check-docstring-first
98
- id: check-executables-have-shebangs
109
- id: check-merge-conflict
1110
- id: check-yaml
1211
- id: end-of-file-fixer
12+
- id: fix-byte-order-marker
1313
- id: mixed-line-ending
1414
- id: no-commit-to-branch
1515
args: [--branch, main]
@@ -29,6 +29,6 @@ repos:
2929
hooks:
3030
- id: isort
3131
- repo: https://github.com/psf/black
32-
rev: 25.1.0
32+
rev: 25.9.0
3333
hooks:
3434
- id: black

CHANGELOG.md

Lines changed: 14 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.21.0] - 2025-09-21
18+
19+
### Added
20+
21+
- `check-munki-pkgsinfo` now detects the incorrect key `condition` and suggests using `installable_condition` instead.
22+
23+
### Changed
24+
25+
- Renamed internal package from `pre_commit_hooks` to `pre_commit_macadmin_hooks` to resolve namespace collision with the official `pre_commit_hooks` [package](https://github.com/pre-commit/pre-commit-hooks). (#78)
26+
1727
## [1.20.0] - 2025-08-09
1828

1929
### Added
@@ -425,7 +435,10 @@ Nothing yet.
425435

426436
- Initial release
427437

428-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.18.0...HEAD
438+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.21.0...HEAD
439+
[1.21.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.20.0...v1.21.0
440+
[1.20.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.19.0...v1.20.0
441+
[1.19.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.18.0...v1.19.0
429442
[1.18.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.17.0...v1.18.0
430443
[1.17.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.16.2...v1.17.0
431444
[1.16.2]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.16.1...v1.16.2

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

148148
```yaml
149149
- repo: https://github.com/homebysix/pre-commit-macadmin
150-
rev: v1.20.0
150+
rev: v1.21.0
151151
hooks:
152152
- id: check-munki-pkgsinfo
153153
args: ['--catalogs', 'testing', 'stable', '--']
@@ -157,7 +157,7 @@ But if you also use the `--categories` argument, you would move the trailing `--
157157

158158
```yaml
159159
- repo: https://github.com/homebysix/pre-commit-macadmin
160-
rev: v1.20.0
160+
rev: v1.21.0
161161
hooks:
162162
- id: check-munki-pkgsinfo
163163
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
@@ -169,7 +169,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu
169169

170170
```yaml
171171
- repo: https://github.com/homebysix/pre-commit-macadmin
172-
rev: v1.20.0
172+
rev: v1.21.0
173173
hooks:
174174
- id: check-munki-pkgsinfo
175175
args: [

pre_commit_hooks/check_autopkg_recipe_list.py renamed to pre_commit_macadmin_hooks/check_autopkg_recipe_list.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import argparse
99
import json
1010
import plistlib
11+
from typing import List, Optional
1112
from xml.parsers.expat import ExpatError
1213

1314
import ruamel.yaml
1415

1516
yaml = ruamel.yaml.YAML(typ="safe")
1617

1718

18-
def build_argument_parser():
19+
def build_argument_parser() -> argparse.ArgumentParser:
1920
"""Build and return the argument parser."""
2021

2122
parser = argparse.ArgumentParser(
@@ -25,7 +26,7 @@ def build_argument_parser():
2526
return parser
2627

2728

28-
def main(argv=None):
29+
def main(argv: Optional[List[str]] = None) -> int:
2930
"""Main process."""
3031

3132
# Parse command line arguments.

pre_commit_hooks/check_autopkg_recipes.py renamed to pre_commit_macadmin_hooks/check_autopkg_recipes.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
import os
77
import sys
88
from contextlib import contextmanager
9+
from typing import Any, Dict, List
910

1011
from packaging.version import Version
1112

12-
from pre_commit_hooks.util import (
13+
from pre_commit_macadmin_hooks.util import (
1314
detect_deprecated_keys,
1415
detect_typoed_keys,
1516
load_autopkg_recipe,
@@ -23,7 +24,7 @@
2324

2425
# Import AutoPkg libraries, but ignore any warnings generated by the import.
2526
@contextmanager
26-
def suppress_stdout():
27+
def suppress_stdout() -> Any:
2728
with open(os.devnull, "w", encoding="utf-8") as devnull:
2829
old_stdout = sys.stdout
2930
sys.stdout = devnull
@@ -36,15 +37,18 @@ def suppress_stdout():
3637
sys.path.append("/Library/AutoPkg")
3738
try:
3839
with suppress_stdout():
39-
from autopkglib import get_processor, processor_names
40+
from autopkglib import ( # type: ignore[import-not-found]
41+
get_processor,
42+
processor_names,
43+
)
4044

4145
HAS_AUTOPKGLIB = True
4246
except ImportError:
4347
# Silently skip checks that require autopkglib.
4448
HAS_AUTOPKGLIB = False
4549

4650

47-
def build_argument_parser():
51+
def build_argument_parser() -> argparse.ArgumentParser:
4852
"""Build and return the argument parser."""
4953

5054
parser = argparse.ArgumentParser(
@@ -83,7 +87,9 @@ def build_argument_parser():
8387
return parser
8488

8589

86-
def validate_recipe_prefix(recipe, filename, prefix):
90+
def validate_recipe_prefix(
91+
recipe: Dict[str, Any], filename: str, prefix: List[str]
92+
) -> bool:
8793
"""Verify that the recipe identifier starts with the expected prefix."""
8894

8995
passed = True

pre_commit_hooks/check_git_config_email.py renamed to pre_commit_macadmin_hooks/check_git_config_email.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import argparse
55
import subprocess
6+
from typing import List, Optional
67

78

8-
def build_argument_parser():
9+
def build_argument_parser() -> argparse.ArgumentParser:
910
"""Build and return the argument parser."""
1011

1112
parser = argparse.ArgumentParser(
@@ -19,7 +20,7 @@ def build_argument_parser():
1920
return parser
2021

2122

22-
def main(argv=None):
23+
def main(argv: Optional[List[str]] = None) -> int:
2324
"""Main process."""
2425

2526
# Parse command line arguments.

pre_commit_hooks/check_jamf_extension_attributes.py renamed to pre_commit_macadmin_hooks/check_jamf_extension_attributes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
import argparse
55
import re
6+
from typing import List, Optional
67

7-
from pre_commit_hooks.util import validate_shebangs
8+
from pre_commit_macadmin_hooks.util import validate_shebangs
89

910

10-
def build_argument_parser():
11+
def build_argument_parser() -> argparse.ArgumentParser:
1112
"""Build and return the argument parser."""
1213

1314
parser = argparse.ArgumentParser(
@@ -23,7 +24,7 @@ def build_argument_parser():
2324
return parser
2425

2526

26-
def main(argv=None):
27+
def main(argv: Optional[List[str]] = None) -> int:
2728
"""Main process."""
2829

2930
# Parse command line arguments.

0 commit comments

Comments
 (0)