Skip to content

Commit

Permalink
Rename hook to format-xml-plist
Browse files Browse the repository at this point in the history
Matches verb-object format of other hooks
  • Loading branch information
homebysix committed Mar 10, 2024
1 parent fb7757f commit 3b963a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@
files: '\.recipe(\.plist|\.yaml|\.json)?$'
types: [text]

- id: format-xml-plist
name: Auto-format plist [XML]
description: Auto-format a Property List (plist) as XML.
entry: plutil -convert xml1
language: system
files: '\.(mobileconfig|pkginfo|plist|recipe)$'
types: [text]

- id: munki-makecatalogs
name: Run Munki Makecatalogs
description: This hook runs the "makecatalogs" command to ensure all referenced packages are present and catalogs are up to date.
entry: munki-makecatalogs
language: python
pass_filenames: false
always_run: true

- id: plist-format-xml
name: Auto-format plist [XML]
description: Auto-format a Property List (plist) as XML.
entry: plutil -convert xml1
language: system
files: '\.(mobileconfig|pkginfo|plist|recipe)$'
types: [text]
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ After adding a hook to your pre-commit config, it's not a bad idea to run `pre-c
This hook checks to ensure the Git config email matches one of the specified domains:
`args: ['--domains', 'pretendco.com', 'contoso.com', '--']`

- __check-plists__

This hook checks XML property list (plist) files for basic syntax errors.

- __check-munkipkg-buildinfo__

This hook checks [MunkiPkg](https://github.com/munki/munki-pkg) build-info files to ensure they are valid.
Expand All @@ -44,10 +40,16 @@ After adding a hook to your pre-commit config, it's not a bad idea to run `pre-c

This hook checks [Outset](https://github.com/chilcote/outset) scripts to ensure they're executable.

- __plist-format-xml__
- __check-plists__

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.

- __format-xml-plist__

This hook will auto-format XML property list (plist) files to use tabs instead of spaces, and will alphabetically sort keys.

__NOTE__: This will remove any HTML-style comments `<!--like this-->` in your plist files, so convert those to `<key>Comment</key>` format first.

### [AutoPkg](https://github.com/autopkg/autopkg)

- __check-autopkg-recipe-list__
Expand Down

0 comments on commit 3b963a0

Please sign in to comment.