rkotze / git-mob

Co-author commits tool. A cross-platform command-line tool for social coding. Includes co-authors in commits when pair/mob programming.
https://www.npmjs.com/package/git-mob
MIT License
182 stars 21 forks source link

The readme instructions on using precommit throws an error #102

Closed timrooke1991 closed 1 year ago

timrooke1991 commented 1 year ago

Prerequisites

Description

The example posted in the read me

// .pre-commit-config.yaml
repos:
  - repo: https://github.com/rkotze/git-mob
    rev: { tag-version }
    hooks:
      - id: add-coauthors
        stages: ["prepare-commit-msg"]

Output: Throws the CLI error - because use of tag-version is not compatible

An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='https://github.com/rkotze/git-mob')
==> At key: rev
=====> Expected string got dict
Check the log at /Users/timrooke/.cache/pre-commit/pre-commit.log

If I solve this issue by pinning the version:

// .pre-commit-config.yaml
repos:
  - repo: https://github.com/rkotze/git-mob
    rev: v2.3.5
    hooks:
      - id: add-coauthors
        stages: ["prepare-commit-msg"]

Output: Throws the CLI error - because .pre-commit-hooks.yaml is not at the root level of the git-mob report

An error has occurred: InvalidManifestError:
=====> /Users/me/.cache/pre-commit/repoycrmzqj6/.pre-commit-hooks.yaml is not a file
Check the log at /Users/me/.cache/pre-commit/pre-commit.log

Steps to Reproduce

  1. brew install pre-commit
  2. Add a .pre-commit-config.yaml with one of the above configurations
  3. Run pre-commit autoupdate (you may see the error in the CLI at this point)
  4. git add . && git commit -m "Add some files"
  5. The pre-commit hook errors as above

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce?]

Versions

Additional Information

rkotze commented 1 year ago

Thanks for raising this. Should be fixed now.