GithubHelp home page GithubHelp logo

pre-commit-macadmin's Introduction

Pre-Commit Hooks for Mac Admins

CodeQL

This repository contains hooks for pre-commit that may be useful to Mac admins, client engineers, and other Apple-focused IT professionals.

Requirements

To use these hooks, you first need to install pre-commit using the instructions here: https://pre-commit.com/#install

Adding hooks to your pre-commit config

For any hook in this repo you wish to use, add the following to your pre-commit config:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.16.2
    hooks:
    -   id: check-plists
    # -   id: ...

After 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.

Hooks available

General

  • check-git-config-email

    This hook checks to ensure the Git config email matches one of the specified domains: args: ['--domains', 'pretendco.com', 'contoso.com', '--']

  • check-munkipkg-buildinfo

    This hook checks MunkiPkg build-info files to ensure they are valid.

  • check-outset-scripts

    This hook checks Outset scripts to ensure they're executable.

  • 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.

  • check-autopkg-recipe-list

    This hook checks AutoPkg recipe lists (in txt, plist, yaml, or json format) for common issues.

  • check-autopkg-recipes

    This hook checks AutoPkg recipes to ensure they meet various requirements and conventions.

    • Optionally 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.)

    • Optionally specify the version of AutoPkg for which you want to ignore MinimumVersion mismatches with processors. args: ['--ignore-min-vers-before=0.5.0']
      (default: 1.0.0)
      Specifying 0.1.0 will not ignore any MinimumVersion mismatches.

    • If you're a purist, you can also enable strict mode. This enforces recipe type conventions, all processor/MinimumVersion mismatches, forbids <!-- --> style comments, and ensures all processor input variables (arguments) are valid.
      args: ['--strict']
      (default: False)

  • forbid-autopkg-overrides

    This hook prevents AutoPkg overrides from being added to the repo.

  • forbid-autopkg-trust-info

    This hook prevents AutoPkg recipes with trust info from being added to the repo.

  • check-jamf-extension-attributes

    This hook checks Jamf extension attributes for common issues. (Looks for EAs in a path containing jamf/extension_attributes or jss/extension_attributes.)

  • check-jamf-scripts

    This hook checks Jamf scripts for common issues. (Looks for scripts in a path containing jamf/scripts or jss/scripts.)

  • check-jamf-profiles

    This hook checks Jamf profiles for common issues. (Looks for profiles in a path containing jamf/profiles or jss/profiles.)

  • check-munki-pkgsinfo

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

    • 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)

    • Specify an alternate munki repo location by passing the argument: args: ['--munki-repo', './my_repo_location'] (default: ".")

    • Choose to just warn on missing icons with a flag, note if no other issues exist this will allow pre-commit to pass without seeing the warnings: args: ['--warn-on-missing-icons]

    • Add additional shebangs that are valid for your environment: args: ['--valid-shebangs', '#!/bin/macadmin/python37', '#!/bin/macadmin/python42', '--']

  • check-munkiadmin-scripts

    This hook ensures MunkiAdmin scripts are executable.

  • munki-makecatalogs

    This hook runs the "makecatalogs" command to ensure all referenced packages are present and catalogs are up to date.

    • Specify an alternate munki repo location by passing the argument: args: ['--munki-repo', './my_repo_location'] (default: ".")

Note about combining arguments

When 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:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.16.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: ['--catalogs', 'testing', 'stable', '--']

But if you also use the --categories argument, you would move the trailing -- to the end, after all the lists, like this:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.16.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: ['--catalogs', 'testing', 'stable', '--categories', 'Design', 'Engineering', 'Web Browsers', '--']

The -- only serves as a signal to the hook that the list of arguments is complete, and is only needed for "list" type arguments.

If it looks better to your eye, feel free to use a multi-line list for long arguments:

-   repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.16.2
    hooks:
    -   id: check-munki-pkgsinfo
        args: [
            '--required-keys', 'description', 'name', 'developer', 'category', 'version',
            '--catalogs', 'testing', 'stable',
            '--categories', 'Communication', 'Design', 'Engineering', 'macOS', 'Printers',
                'Productivity', 'Security',  'Utilities', 'Web Browsers',
            '--']

Recommendations

If you find my hooks useful, you may also want to use one or more of the Python, Markdown, and Git-related hooks listed here: https://pre-commit.com/hooks.html

Specifically, here are a few I use for Mac admin work:

  • check-added-large-files
  • check-executables-have-shebangs
  • check-merge-conflict
  • check-yaml
  • detect-aws-credentials
  • detect-private-key
  • mixed-line-ending
  • no-commit-to-branch
  • trailing-whitespace

pre-commit-macadmin's People

Contributors

aaronburchfield avatar billybco avatar homebysix avatar kbrewersq avatar n8felton avatar relgit avatar sadikkuzu avatar wardsparadox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pre-commit-macadmin's Issues

pkginfo key description should be type <type 'str'>, not type <type 'unicode'>

Running pre-commit run --all-files on dataJAR-recipes resulted in:

AirParrot 2-Trial/AirParrot 2-Trial.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Backup Manager/Backup Manager.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
BlueGriffon/BlueGriffon.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
BoxDrive/BoxDrive.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Cubase 9/Cubase 9.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
FlashPrint/FlashPrint.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Google Backup and Sync/Google Backup and Sync.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Malwarebytes Breach Remediation-Command Line Interface/Malwarebytes Breach Remediation-Command Line Interface.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Microsoft OneNote 365/Microsoft OneNote 365.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Noun Project/Noun Project.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
QLab4/QLab4.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Racket 6/Racket 6.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Racket 7/Racket 7.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
renpy 6/renpy 6.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
renpy 7/renpy 7.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
Suitcase Fusion 9/Suitcase Fusion 9.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
SwitchResX4-Trial/SwitchResX4-Trial.munki.recipe: pkginfo key developer should be type <type 'str'>, not type <type 'unicode'>
US-20x20_SettingsPanel/US-20x20_SettingsPanel.download.recipe: recipe identifier does not start with "com.github.dataJAR-recipes."
US-20x20_SettingsPanel/US-20x20_SettingsPanel.munki.recipe: recipe identifier does not start with "com.github.dataJAR-recipes."
US-20x20_SettingsPanel/US-20x20_SettingsPanel.pkg.recipe: recipe identifier does not start with "com.github.dataJAR-recipes."
WaveLab Elements 9.5/WaveLab Elements 9.5.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
WaveLab LE 9.5/WaveLab LE 9.5.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>
WaveLab LE 9/WaveLab LE 9.munki.recipe: pkginfo key description should be type <type 'str'>, not type <type 'unicode'>

These are all valid XML, & some are just due to being used in place of '.. I think this is too harsh

Adjust profile manifest requirements for `pfm_name` and `pfm_type`

Copying over @apizz's comments from this pull request.

One thing I did discover is that while it will fail to let me commit if I remove the pfm_type key it will notably commit just fine without a pfm_name key. It's required for top-level keys (first layer of pfm_subkeys) but not for all items in the layer below that (thinking of an array with a subkey that's a string). Not sure how difficult it would be to add this just at the layer we need, but if we could get that included as a required key that would be awesome!

Conflicting util.py with pre-commit-hooks' util.py

Maybe it's my fault in setting up pre-commit-hooks, but I came across a conflict in util.py when using pre-commit-hooks from https://github.com/pre-commit/pre-commit-hooks and this https://github.com/homebysix/pre-commit-macadmin.

check-merge-conflict worked until I added this repo for check-git-config-email hook:

✦ ↳ pre-commit
check for merge conflicts................................................Failed
- hook id: check-merge-conflict
- exit code: 1

Traceback (most recent call last):
  File "/opt/homebrew/bin/check-merge-conflict", line 5, in <module>
    from pre_commit_hooks.check_merge_conflict import main
  File "/Users/kyoshiro/dev/git/myrepo/_build/pip_packages/lib/python3.11/site-packages/pre_commit_hooks/check_merge_conflict.py", line 7, in <module>
    from pre_commit_hooks.util import cmd_output
ImportError: cannot import name 'cmd_output' from 'pre_commit_hooks.util' (/Users/kyoshiro/dev/git/myrepo/_build/pip_packages/lib/python3.11/site-packages/pre_commit_hooks/util.py)

check yaml...............................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
Check Git Config Email...................................................Passed
Terraform validate with tflint.......................(no files to check)Skipped
Terraform validate with trivy........................(no files to check)Skipped
prettier.................................................................Passed

My pre-commit-config:

✦ 1 ✗ cat .pre-commit-config.yaml
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: check-merge-conflict
      - id: check-yaml
      - id: end-of-file-fixer
      - id: mixed-line-ending
      - id: trailing-whitespace
  - repo: https://github.com/homebysix/pre-commit-macadmin
    rev: v1.15.0
    hooks:
      - id: check-git-config-email
        args: ["--domains", "example.domain"]
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.86.0
    hooks:
      - id: terraform_tflint
      - id: terraform_trivy
        args:
          - >
            --args=--tf-exclude-downloaded-modules
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v4.0.0-alpha.8
    hooks:
      - id: prettier

It seems, this repo overwrites the util.py of pre-commit-hooks. But maybe I am wrong in setting things up correctly.

To use this repo for check-git-config-email I disabled check-merge-conflict to workaround the issue above.

Validate `Identifier != ParentRecipe`

Enhancement request for https://github.com/homebysix/pre-commit-macadmin/blob/main/pre_commit_hooks/check_autopkg_recipes.py

This should be a rare problem to encounter, but I have definitely done this accidentally.

If you define the Identifier to be exactly the same as the ParentRecipe within the same recipe, then it causes an infinite loop within AutoPkg and it runs for a very very long time before eventually erroring out.

This has mostly happened to me when creating a new recipe for the first time and having an error in my copy / paste when setting the new Identifier or ParentRecipe, but it is quite annoying.

Would be helpful to have number of errors in output and/or summary

THIS IS MY BAD, I MISSED AN ERROR!

I am triggering this precommit here: https://github.com/jgstew/NickETH-recipes/blob/160889bcd448cada2a0127a76431f7bdd5795fdb/.pre-commit-config.yaml#L7-L13

and yet it seems to be failing with exit code 1 even though all items are WARNINGS: https://github.com/jgstew/NickETH-recipes/runs/6026225280?check_suite_focus=true

Output:

/opt/hostedtoolcache/Python/3.10.4/x64/bin/pre-commit run --show-diff-on-failure --color=always --all-files
[INFO] Initializing environment for https://github.com/homebysix/pre-commit-macadmin.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Installing environment for https://github.com/homebysix/pre-commit-macadmin.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Check AutoPkg Recipe List............................(no files to check)Skipped
Check AutoPkg Recipes....................................................Failed
- hook id: check-autopkg-recipes
- exit code: 1

Adobe/AdobeAIR-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AdoptOpenJDK/AdoptOpenJDK11JRE-Win[64](https://github.com/jgstew/NickETH-recipes/runs/6026225280?check_suite_focus=true#step:4:64).build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/MicrosoftEdge-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
MiKTeX/MiKTeX-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Google/GoogleChrome-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/DotNetCoreDesktopRuntime-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Fujitsu/FujitsuDeskUpdate-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Serif/AffinityPhoto-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/MicrosoftWebView2EvergreenBootstrapper-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mozilla/Thunderbird-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Prusa/PrusaSlicerStandalone-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
CrystalMaker/CrystalMaker-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
NXLog/NXLog-CE-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
NotepadPlusPlus/NotepadPlusPlus-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumIcedTeaWeb-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Filemaker/FileMaker16Updater-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
TexStudio/TexStudio-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
PuTTY/PuTTY-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Apple/iTunes-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Tenable/Nessus-Agent-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
GIMP/GIMP-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mozilla/Thunderbird-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Github/GithubDesktop-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJDKMSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/Teams-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeReaderDC-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJRE11-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Apple/iTunes-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Keepass/Keepass-LANG.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Serif/AffinityPublisher-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
RStudio/RStudio-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
R/R-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumIcedTeaWeb-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Keepass/Keepass-MSI.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
SEH/UTN_Manager-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Jabref/Jabref-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mendeley/Mendeley-Desktop-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Google/GoogleChromeMSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeFlashPlayerPG-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Github/Git-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Keepass/Keepass-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
OBS/OBS-Studio-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AmazonCorettoJDK8/AmazonCorettoJDK8MSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mozilla/Firefox-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Citrix/Citrix-Workspace-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Python/Python-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Bitwarden/BitwardenDesktop-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Slack/Slack-MSI.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Serif/AffinityDesigner-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Inkscape/Inkscape-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
MiKTeX/MiKTeX-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AmazonCorettoJDK8/AmazonCorettoJDK8-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Google/GoogleSyncMSI-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/MicrosoftPowerToys-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Netop/NetopVisionPro-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
XnView/XnView-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Netop/NetopVisionPro-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Element/Element-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Lenovo/ThinkpadSystemUpdate-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
NotepadPlusPlus/NotepadPlusPlus-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
NotepadPlusPlus/NotepadPlusPlus-Win64.build.recipe: Contains a download processor, but no EndOfCheckPhase processor.
Adoptium/AdoptiumOpenJDK8-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
NXLog/NXLog-CE-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeFlashPlayerAX-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Filemaker/FileMaker19Updater-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mersive/SolsticeClient-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
VLC/VLC-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Enpass/Enpass-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/DotNetDesktopRuntime-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeAIR-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Dropbox/DropboxClient-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
IBM/SpectrumProtect-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
LibreOffice/LibreOffice-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AutoPkgWin/AutoPkg-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
WinMerge/WinMerge-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
ImageJ/Fiji-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeReaderDCMSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Enpass/Enpass-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
FileZilla/FileZilla-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
VMware/VMwareVMRC-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJRE8-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
SEH/UTN_Manager-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
7-Zip/7-Zip-MSI.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mozilla/Firefox-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJRE11-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJRE8-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adobe/AdobeFlashPlayerMSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
ImageJ/Fiji-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
SafeExamBrowser/SafeExamBrowser-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/DotNetCoreDesktopRuntime-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/MicrosoftWebView2Runtime-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/DotNetDesktopRuntime-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AdoptOpenJDK/AdoptOpenJDKMSI-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mersive/SolsticeClient-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Google/GoogleSync-Win64.build/zzTest_GoogleSyncMSI-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJDK11-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Zoom/ZoomClient-Win64.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Mozilla/Thunderbird-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJDK11-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Adoptium/AdoptiumOpenJDK8-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Microsoft/Teams-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
AutoPkgWin/AutoPkg-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Google/GoogleChrome-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Macrobond/Macrobond-Win64.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Fujitsu/FujitsuDeskUpdate-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Zoom/ZoomClient-Win.build.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
Prusa/PrusaSlicerStandalone-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.
VMware/VMwareTools-Win.download.recipe: WARNING: Recommend converting from <!-- --> style comments to a Comment key.

Forbid AutoPkg Overrides.................................................Passed
Check Yaml...............................................................Passed
Check for added large files..............................................Passed
Check python ast.........................................................Passed
Check for case conflicts.................................................Passed
Check for merge conflicts................................................Passed
Fix requirements.txt.................................(no files to check)Skipped
Detect Private Key.......................................................Passed
yamllint.................................................................Passed
Error: The process '/opt/hostedtoolcache/Python/3.10.4/x64/bin/pre-commit' failed with exit code 1

Unhandled exception in check-git-config-email

When git config --get user.email returns non-zero exit status, check-git-config-email should handle this situation.

To reproduce:

docker run -it --rm python:latest bash -xc '\
cd ; \
pip install pre-commit ; \
git clone https://github.com/homebysix/pre-commit-macadmin.git ; \
cd pre-commit-macadmin ; \
git checkout --track origin/dev; \
pre-commit autoupdate; \
pre-commit run -a; \
echo "  - repo: https://github.com/homebysix/pre-commit-macadmin" >> .pre-commit-config.yaml; \
echo "    rev: v1.12.2" >> .pre-commit-config.yaml; \
echo "    hooks:" >> .pre-commit-config.yaml; \
echo "    -   id: check-git-config-email" >> .pre-commit-config.yaml; \
echo "        args:" >> .pre-commit-config.yaml; \
echo "          - \"--domains\"" >> .pre-commit-config.yaml; \
echo "          - \"acme.com\"" >> .pre-commit-config.yaml; \
echo "          - \"paramount.com\"" >> .pre-commit-config.yaml; \
echo "        always_run: true" >> .pre-commit-config.yaml; \
echo "        exclude: ^$" >> .pre-commit-config.yaml; \
pre-commit run -a; \
git config --global user.email; \
echo $?;'

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.