Skip to content

Commit

Permalink
Added args documentation to read me
Browse files Browse the repository at this point in the history
  • Loading branch information
homebysix committed Mar 15, 2019
1 parent 86afee2 commit a7ef9f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ For any hook in this repo you wish to use, add the following to your pre-commit

This hook checks AutoPkg recipes to ensure they contain required top-level keys.

- Specify your preferred AutoPkg recipe and/or override prefix, if you wish to enforce it:
`[--override-prefix=com.yourcompany.autopkg.]` (default: `local.`)
`[--recipe-prefix=com.github.yourusername.]` (default: `com.github.`)
- Specify your preferred AutoPkg recipe and/or override prefix, if you wish to enforce them:
`args: ['--override-prefix=com.yourcompany.autopkg.']`
(default: `local.`)
`args: ['--recipe-prefix=com.github.yourusername.']`
(default: `com.github.`)

- __forbid-autopkg-overrides__

Expand Down Expand Up @@ -63,12 +65,13 @@ For any hook in this repo you wish to use, add the following to your pre-commit

This hook checks Munki pkginfo files to ensure they are valid.

- Specify your preferred list of pkginfo catalogs, if you wish to enforce it:
`[--catalogs, testing, stable]`
- Specify your preferred list of pkginfo categories, if you wish to enforce it:
`[--categories, Productivity, Design, Utilities, 'Web Browsers']`
- Specify required pkginfo keys:
`[--required-keys, category, description, developer, name, version]` (default: description, name)
- Specify your preferred list of pkginfo catalogs, if you wish to enforce it, followed by `--` to signal the end of the list:
`args: ['--catalogs', 'testing', 'stable', '--']`
- Specify your preferred list of pkginfo categories, if you wish to enforce it, followed by `--`:
`args: ['--categories', 'Productivity', 'Design', 'Utilities', 'Web Browsers', '--']`
- Specify required pkginfo keys, followed by `--`:
`args: ['--required-keys', 'category', 'description', 'developer', 'name', 'version', '--']`
(default: description, name)

- __check-munkiadmin-scripts__

Expand Down
4 changes: 2 additions & 2 deletions pre_commit_hooks/check_munki_pkgsinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def build_argument_parser():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument("filenames", nargs="*", help="Filenames to check.")
parser.add_argument("--categories", nargs="+", help="List of approved categories.")
parser.add_argument("--catalogs", nargs="+", help="List of approved catalogs.")
parser.add_argument(
"--required-keys",
nargs="+",
default=["description", "name"],
help="List of required pkginfo keys.",
help="List of required top-level keys.",
)
parser.add_argument("filenames", nargs="*", help="Filenames to check.")
return parser


Expand Down

0 comments on commit a7ef9f1

Please sign in to comment.