Skip to content

Commit

Permalink
Merge pull request #20 from homebysix/1.1.2
Browse files Browse the repository at this point in the history
1.1.2 merge to master
  • Loading branch information
homebysix authored Jun 22, 2019
2 parents f92b617 + 7e87f7e commit 86177f9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For any hook in this repo you wish to use, add the following to your pre-commit

```
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.1.1
rev: v1.1.2
hooks:
- id: check-plists
# - id: ...
Expand Down Expand Up @@ -105,7 +105,7 @@ When combining arguments that take lists (for example: `--required-keys`, `--cat

```
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.1.1
rev: v1.1.2
hooks:
- id: check-munki-pkgsinfo
args: ['--catalogs', 'testing', 'stable', '--']
Expand All @@ -115,7 +115,7 @@ But if you also use the `--categories` argument, you would move the trailing `--

```
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.1.1
rev: v1.1.2
hooks:
- id: check-munki-pkgsinfo
args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']
Expand All @@ -127,7 +127,7 @@ If it looks better to your eye, feel free to use a multi-line list for long argu

```
- repo: https://github.com/homebysix/pre-commit-macadmin
rev: v1.1.1
rev: v1.1.2
hooks:
- id: check-munki-pkgsinfo
args: [
Expand Down
50 changes: 50 additions & 0 deletions pre_commit_hooks/check_autopkg_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import argparse
import plistlib
from xml.parsers.expat import ExpatError
from distutils.version import LooseVersion

from pre_commit_hooks.util import validate_pkginfo_key_types

Expand Down Expand Up @@ -55,6 +56,7 @@ def main(argv=None):
except (ExpatError, ValueError) as err:
print("{}: plist parsing error: {}".format(filename, err))
retval = 1
break # No need to continue checking this file

if args.override_prefix and "Process" not in recipe:
override_prefix = args.override_prefix
Expand All @@ -80,6 +82,54 @@ def main(argv=None):
if not validate_pkginfo_key_types(input["pkginfo"], filename):
retval = 1

# Ensure MinimumVersion is set appropriately for the processors used.
processor_min_versions = {
"AppPkgCreator": "1.0.0",
"BrewCaskInfoProvider": "0.2.5",
"CodeSignatureVerifier": "0.3.1",
"CURLDownloader": "0.5.1",
"CURLTextSearcher": "0.5.1",
"DeprecationWarning": "1.1.0",
"EndOfCheckPhase": "0.1.0",
"FileFinder": "0.2.3",
"FileMover": "0.2.9",
"FlatPkgPacker": "0.2.4",
"FlatPkgUnpacker": "0.1.0",
"GitHubReleasesInfoProvider": "0.5.0",
"Installer": "0.4.0",
"InstallFromDMG": "0.4.0",
"MunkiCatalogBuilder": "0.1.0",
"MunkiImporter": "0.1.0",
"MunkiInstallsItemsCreator": "0.1.0",
"MunkiPkginfoMerger": "0.1.0",
"MunkiSetDefaultCatalog": "0.4.2",
"PackageRequired": "0.5.1",
"PathDeleter": "0.1.0",
"PkgCopier": "0.1.0",
"PkgExtractor": "0.1.0",
"PkgPayloadUnpacker": "0.1.0",
"PlistEditor": "0.1.0",
"PlistReader": "0.2.5",
"SparkleUpdateInfoProvider": "0.1.0",
"StopProcessingIf": "0.1.0",
"Symlinker": "0.1.0",
"Unarchiver": "0.1.0",
"URLTextSearcher": "0.2.9",
"Versioner": "0.1.0",
}
if "Process" in recipe and "MinimumVersion" in recipe:
for proc in processor_min_versions:
if proc in [x["Processor"] for x in recipe["Process"]]:
if LooseVersion(recipe["MinimumVersion"]) < LooseVersion(
processor_min_versions[proc]
):
print(
"{}: {} processor requires minimum AutoPkg version {}".format(
filename, proc, processor_min_versions[proc]
)
)
retval = 1

return retval


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name="pre-commit-macadmin",
description="Pre-commit hooks for Mac admins, client engineers, and IT consultants.",
url="https://github.com/homebysix/pre-commit-macadmin",
version="1.1.1",
version="1.1.2",
author="Elliot Jordan",
author_email="[email protected]",
packages=["pre_commit_hooks"],
Expand Down

0 comments on commit 86177f9

Please sign in to comment.