Skip to content

Commit 5ee621c

Browse files
authored
Merge pull request #109 from homebysix/dev
1.23.0 merge to main
2 parents 22c5b93 + 1bde761 commit 5ee621c

6 files changed

Lines changed: 27 additions & 9 deletions

File tree

CHANGELOG.md

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

1313
## [Unreleased]
1414

15+
Nothing yet.
16+
17+
## [1.23.0] - 2026-03-19
18+
1519
### Added
1620

1721
- Added support for minimum AutoPkg version validation for new [VariableSetter](https://github.com/autopkg/autopkg/wiki/Processor-VariableSetter) processor.
22+
- `check-munkiadmin-scripts` and `check-outset-scripts` now support the `--valid-shebangs` argument for specifying additional valid interpreter paths.
1823

1924
### Changed
2025

@@ -453,7 +458,8 @@ All notable changes to this project will be documented in this file. This projec
453458

454459
- Initial release
455460

456-
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.22.0...HEAD
461+
[Unreleased]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.23.0...HEAD
462+
[1.23.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.22.0...v1.23.0
457463
[1.22.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.21.0...v1.22.0
458464
[1.21.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.20.0...v1.21.0
459465
[1.20.0]: https://github.com/homebysix/pre-commit-macadmin/compare/v1.19.0...v1.20.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.22.1
18+
rev: v1.23.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.22.1
150+
rev: v1.23.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.22.1
160+
rev: v1.23.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.22.1
172+
rev: v1.23.0
173173
hooks:
174174
- id: check-munki-pkgsinfo
175175
args: [

pre_commit_macadmin_hooks/check_munkiadmin_scripts.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def build_argument_parser() -> argparse.ArgumentParser:
1515
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
1616
)
1717
parser.add_argument("filenames", nargs="*", help="Filenames to check.")
18+
parser.add_argument(
19+
"--valid-shebangs",
20+
nargs="+",
21+
default=[],
22+
help="Add other valid shebangs for your environment",
23+
)
1824
return parser
1925

2026

@@ -48,7 +54,7 @@ def main(argv: Optional[List[str]] = None) -> int:
4854
# Ensure scripts have a proper shebang
4955
with open(filename, encoding="utf-8") as openfile:
5056
script_content = openfile.read()
51-
if not validate_shebangs(script_content, filename):
57+
if not validate_shebangs(script_content, filename, args.valid_shebangs):
5258
print(f"{filename}: does not start with a valid shebang")
5359
retval = 1
5460

pre_commit_macadmin_hooks/check_outset_scripts.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def build_argument_parser() -> argparse.ArgumentParser:
1515
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
1616
)
1717
parser.add_argument("filenames", nargs="*", help="Filenames to check.")
18+
parser.add_argument(
19+
"--valid-shebangs",
20+
nargs="+",
21+
default=[],
22+
help="Add other valid shebangs for your environment",
23+
)
1824
return parser
1925

2026

@@ -34,7 +40,7 @@ def main(argv: Optional[List[str]] = None) -> int:
3440
# Ensure scripts have a proper shebang
3541
with open(filename, encoding="utf-8") as openfile:
3642
script_content = openfile.read()
37-
if not validate_shebangs(script_content, filename):
43+
if not validate_shebangs(script_content, filename, args.valid_shebangs):
3844
print(f"{filename}: does not start with a valid shebang")
3945
retval = 1
4046

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name="pre-commit-macadmin",
77
description="Pre-commit hooks for Mac admins, client engineers, and IT consultants.",
88
url="https://github.com/homebysix/pre-commit-macadmin",
9-
version="1.22.1",
9+
version="1.23.0",
1010
author="Elliot Jordan",
1111
author_email="elliot@elliotjordan.com",
1212
packages=["pre_commit_macadmin_hooks"],

tests/test_check_autopkg_recipe_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_yaml_parsing_error(self):
165165
with tempfile.TemporaryDirectory() as tmpdir:
166166
yaml_file = os.path.join(tmpdir, "bad.yaml")
167167
with open(yaml_file, "w", encoding="utf-8") as f:
168-
f.write(":\n-")
168+
f.write(":\n :\n-\n :")
169169
retval, output = self.run_main_with_files([yaml_file])
170170
self.assertEqual(retval, 1)
171171
self.assertIn("yaml parsing error", output)

0 commit comments

Comments
 (0)