{"id":19639002,"url":"https://github.com/homebysix/pre-commit-macadmin","last_synced_at":"2026-04-12T20:06:21.995Z","repository":{"id":42217047,"uuid":"173013120","full_name":"homebysix/pre-commit-macadmin","owner":"homebysix","description":"Pre-commit hooks for Mac admins.","archived":false,"fork":false,"pushed_at":"2026-03-16T22:40:42.000Z","size":387,"stargazers_count":69,"open_issues_count":5,"forks_count":17,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-17T09:21:57.886Z","etag":null,"topics":["apple","autopkg","hacktoberfest","jamf","mac","macadmin","macdevops","macos","munki","munkipkg","outset"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/homebysix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-28T00:40:17.000Z","updated_at":"2026-03-10T20:06:11.000Z","dependencies_parsed_at":"2023-11-18T12:24:42.026Z","dependency_job_id":"693131ff-646d-4db6-ac4c-5aea5b60f925","html_url":"https://github.com/homebysix/pre-commit-macadmin","commit_stats":{"total_commits":303,"total_committers":9,"mean_commits":"33.666666666666664","dds":0.07920792079207917,"last_synced_commit":"dcf837e9504c628bd832e3cb73b83cf820679572"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/homebysix/pre-commit-macadmin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebysix%2Fpre-commit-macadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebysix%2Fpre-commit-macadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebysix%2Fpre-commit-macadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebysix%2Fpre-commit-macadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homebysix","download_url":"https://codeload.github.com/homebysix/pre-commit-macadmin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homebysix%2Fpre-commit-macadmin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","autopkg","hacktoberfest","jamf","mac","macadmin","macdevops","macos","munki","munkipkg","outset"],"created_at":"2024-11-11T12:43:31.828Z","updated_at":"2026-04-01T19:02:04.418Z","avatar_url":"https://github.com/homebysix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pre-Commit Hooks for Mac Admins\n\n![CodeQL](https://github.com/homebysix/pre-commit-macadmin/workflows/CodeQL/badge.svg)\n\nThis repository contains hooks for [pre-commit](https://pre-commit.com/hooks.html) that may be useful to Mac admins, client engineers, and other Apple-focused IT professionals.\n\n## Requirements\n\nTo use these hooks, you first need to install pre-commit using the instructions here:\nhttps://pre-commit.com/#install\n\n## Adding hooks to your pre-commit config\n\nFor any hook in this repo you wish to use, add the following to your pre-commit config:\n\n```yaml\n-   repo: https://github.com/homebysix/pre-commit-macadmin\n    rev: v1.23.0\n    hooks:\n    -   id: check-plists\n    # -   id: ...\n```\n\nAfter adding a hook to your pre-commit config, it's not a bad idea to run `pre-commit autoupdate` to ensure you have the latest version of the hooks.\n\n## Hooks available\n\n### General\n\n- __check-git-config-email__\n\n    This hook checks to ensure the Git config email matches one of the specified domains:\n        `args: ['--domains', 'pretendco.com', 'contoso.com', '--']`\n\n- __check-munkipkg-buildinfo__\n\n    This hook checks [MunkiPkg](https://github.com/munki/munki-pkg) build-info files to ensure they are valid.\n\n- __check-outset-scripts__\n\n    This hook checks [Outset](https://github.com/chilcote/outset) scripts to ensure they're executable.\n\n- __check-plists__\n\n    This hook checks XML property list (plist) files for basic syntax errors. Does not modify or autoformat these files; see the `format-xml-plist` hook below if you want autoformatting.\n\n- __format-xml-plist__\n\n    This hook will auto-format XML property list (plist) files to use tabs instead of spaces, and will alphabetically sort keys.\n\n    __NOTE__: This will remove any HTML-style comments `\u003c!--like this--\u003e` in your plist files, so convert those to `\u003ckey\u003eComment\u003c/key\u003e` format first.\n\n### [AutoPkg](https://github.com/autopkg/autopkg)\n\n- __check-autopkg-recipe-list__\n\n    This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues.\n\n- __check-autopkg-recipes__\n\n    This hook checks AutoPkg recipes to ensure they meet various requirements and conventions.\n\n    - Optionally specify your preferred AutoPkg recipe and/or override prefix, if you wish to enforce them:\n        `args: ['--override-prefix=com.yourcompany.autopkg.']`\n        (default: `local.`)\n        `args: ['--recipe-prefix=com.github.yourusername.']`\n        (default: `com.github.`)\n\n    - Optionally specify the version of AutoPkg for which you want to ignore MinimumVersion mismatches with processors.\n        `args: ['--ignore-min-vers-before=0.5.0']`\n        (default: `1.0.0`)\n        Specifying `0.1.0` will not ignore any MinimumVersion mismatches.\n\n    - If you're a purist, you can also enable strict mode. This enforces recipe type conventions, all processor/MinimumVersion mismatches, forbids `\u003c!-- --\u003e` style comments, and ensures all processor input variables (arguments) are valid.\n        `args: ['--strict']`\n        (default: False)\n\n- __forbid-autopkg-overrides__\n\n    This hook prevents AutoPkg overrides from being added to the repo.\n\n- __forbid-autopkg-trust-info__\n\n    This hook prevents AutoPkg recipes with trust info from being added to the repo.\n\n### [Jamf](https://www.jamf.com/)\n\n- __check-jamf-extension-attributes__\n\n    This hook checks Jamf extension attributes for common issues. (Looks for EAs in a path containing jamf/extension_attributes or jss/extension_attributes.)\n\n- __check-jamf-scripts__\n\n    This hook checks Jamf scripts for common issues. (Looks for scripts in a path containing jamf/scripts or jss/scripts.)\n\n- __check-jamf-profiles__\n\n    This hook checks Jamf profiles for common issues. (Looks for profiles in a path containing jamf/profiles or jss/profiles.)\n\n### [Munki](https://github.com/munki/munki)\n\n- __check-munki-pkgsinfo__\n\n    This hook checks Munki pkginfo files to ensure they are valid.\n\n    - Specify your preferred list of pkginfo catalogs, if you wish to enforce it, followed by `--` to signal the end of the list:\n        `args: ['--catalogs', 'testing', 'stable', '--']`\n\n    - Specify your preferred list of pkginfo categories, if you wish to enforce it, followed by `--`:\n        `args: ['--categories', 'Productivity', 'Design', 'Utilities', 'Web Browsers', '--']`\n\n    - Specify required pkginfo keys, followed by `--`:\n        `args: ['--required-keys', 'category', 'description', 'developer', 'name', 'version', '--']`\n        (default: description, name)\n\n    - Specify an alternate munki repo location by passing the argument:\n        `args: ['--munki-repo', './my_repo_location']`\n        (default: \".\")\n\n    - Choose to just warn if icons referenced in pkginfo files are missing (this will allow pre-commit checks to pass if no other issues exist):\n        `args: ['--warn-on-missing-icons]`\n\n    - Choose to just warn if installer/uninstaller items (`installer_item_location` or `uninstaller_item_location`) referenced in pkginfo files are missing (this will allow pre-commit checks to pass if no other issues exist):\n        `args: ['--warn-on-missing-installer-items]`\n\n    - Choose to just warn if pkg/pkginfo files with __1 (or similar) suffixes are detected (this will allow pre-commit checks to pass if no other issues exist):\n        `args: ['--warn-on-duplicate-imports]`\n\n    - Add additional shebangs that are valid for your environment:\n        `args: ['--valid-shebangs', '#!/bin/macadmin/python37', '#!/bin/macadmin/python42', '--']`\n\n- __check-munkiadmin-scripts__\n\n    This hook ensures MunkiAdmin scripts are executable.\n\n- __munki-makecatalogs__\n\n    This hook runs the \"makecatalogs\" command to ensure all referenced packages are present and catalogs are up to date.\n\n    - Specify an alternate munki repo location by passing the argument:\n        `args: ['--munki-repo', './my_repo_location']`\n        (default: \".\")\n\n## Note about combining arguments\n\nWhen combining arguments that take lists (for example: `--required-keys`, `--catalogs`, and `--categories`), only the _last_ list needs to have a trailing `--`. For example, if you use the check-munki-pkgsinfo hook with only the `--catalogs` argument, your yaml config would look like this:\n\n```yaml\n-   repo: https://github.com/homebysix/pre-commit-macadmin\n    rev: v1.23.0\n    hooks:\n    -   id: check-munki-pkgsinfo\n        args: ['--catalogs', 'testing', 'stable', '--']\n```\n\nBut if you also use the `--categories` argument, you would move the trailing `--` to the end, after all the lists, like this:\n\n```yaml\n-   repo: https://github.com/homebysix/pre-commit-macadmin\n    rev: v1.23.0\n    hooks:\n    -   id: check-munki-pkgsinfo\n        args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']\n```\n\nThe `--` only serves as a signal to the hook that the list of arguments is complete, and is only needed for \"list\" type arguments.\n\nIf it looks better to your eye, feel free to use a multi-line list for long arguments:\n\n```yaml\n-   repo: https://github.com/homebysix/pre-commit-macadmin\n    rev: v1.23.0\n    hooks:\n    -   id: check-munki-pkgsinfo\n        args: [\n            '--required-keys', 'description', 'name', 'developer', 'category', 'version',\n            '--catalogs', 'testing', 'stable',\n            '--categories', 'Communication', 'Design', 'Engineering', 'macOS', 'Printers',\n                'Productivity', 'Security',  'Utilities', 'Web Browsers',\n            '--']\n```\n\n## Recommendations\n\nIf you find my hooks useful, you may also want to use one or more of the Python, Markdown, and Git-related hooks listed here:\nhttps://pre-commit.com/hooks.html\n\nSpecifically, here are a few I use for Mac admin work:\n\n- `check-added-large-files`\n- `check-executables-have-shebangs`\n- `check-merge-conflict`\n- `check-yaml`\n- `detect-aws-credentials`\n- `detect-private-key`\n- `mixed-line-ending`\n- `no-commit-to-branch`\n- `trailing-whitespace`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebysix%2Fpre-commit-macadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomebysix%2Fpre-commit-macadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomebysix%2Fpre-commit-macadmin/lists"}