Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking changes in 1.5.2 and 1.5.3 - InvalidManifestError #83

Closed
tyriis opened this issue Aug 7, 2023 · 3 comments
Closed

breaking changes in 1.5.2 and 1.5.3 - InvalidManifestError #83

tyriis opened this issue Aug 7, 2023 · 3 comments

Comments

@tyriis
Copy link

tyriis commented Aug 7, 2023

It seem that something is not working as expected in the latest version

pre-commit version: 3.1.0
git --version: git version 2.41.0
sys.version:
    3.10.10 (main, Feb  7 2023, 12:19:31) [GCC 12.2.0]
sys.executable: /nix/store/syz2y6j53y5hpzbs7l0965zwxshi8iyl-python3-3.10.10/bin/python3.10
os.name: posix
sys.platform: linux

error information

An error has occurred: InvalidManifestError: 
==> File ~/.cache/pre-commit/repofbad9rxa/.pre-commit-hooks.yaml
==> At Hook(id='forbid-crlf')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
Check the log at ~/.cache/pre-commit/pre-commit.log

It seems, that version constraint check is not working as it should, but I am sure it is not related to the hook but to the framework.

@tyriis
Copy link
Author

tyriis commented Aug 7, 2023

From my point of view this is a breaking change and should not be introduced without a major (or at least minor) version and a note in the Release info. I am using your hooks everywhere and managing the upgrade with renovate (as many others).

@tyriis
Copy link
Author

tyriis commented Aug 7, 2023

for people looking for a solution: upgrade to pre-commit latest version (currently 3.3.3) and it will work.

On Arch I am not able to switch to the 3.3.3 version natively, instead (as a quickfix) I use nix to bypass the aur packaging system (use channel unstable) nix-shell -p pre-commit or nix-shell -p pre-commit --run zsh (I also needed to clean pre-commit cache and do a fresh install/init) (:warning: nix pre-commit uses its own path in .git/hooks/pre-commit)

@Lucas-C
Copy link
Owner

Lucas-C commented Aug 11, 2023

Thank you for reporting this @tyriis 👍

It seems, that version constraint check is not working as it should, but I am sure it is not related to the hook but to the framework.

The new stages entry was added in .pre-commit-hooks.yaml by @xaver-k in PR #75

The stages used have been introduced in pre-commit version 3.2.0:
https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md#320---2023-03-17

This means that this hook since v1.5.2 must be used with pre-commit 3.2.0 or superior. I'm going to add that to the README.md and mention it in the latest releases.

@Lucas-C Lucas-C closed this as completed Aug 11, 2023
nriley added a commit to nriley/talon_community that referenced this issue Sep 16, 2023
More information on the issue this is working around:

Lucas-C/pre-commit-hooks#83
nriley added a commit to talonhub/community that referenced this issue Sep 16, 2023
More information on the issue this is working around:

Lucas-C/pre-commit-hooks#83
davidberenstein1957 pushed a commit to argilla-io/argilla that referenced this issue Oct 27, 2023
# Argilla Community Growers

Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged.

# Pull Request Templates

Please go the the `Preview` tab and select the appropriate sub-template:

* [🐞-bug](?expand=1&template=bug.md)
* [📚-documentation](?expand=1&template=docs.md)
* [🆕-features](?expand=1&template=features.md)

I tried to select "bug", but it didn't work for me ... maybe too tired.

# Generic Pull Request Template

I created a new conda env with the `environment_dev.yml` and encountered
[this issue](Lucas-C/pre-commit-hooks#83).
Bumping up the pre-commit version fixes it.

Closes #<issue_number>

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (change restructuring the codebase without changing
functionality)
- [ ] Improvement (change adding some improvement to an existing
functionality)
- [ ] Documentation update

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] follows the style guidelines of this project
- [ ] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
MartinRykfors pushed a commit to MartinRykfors/knausj_talon that referenced this issue Nov 6, 2023
code-n-cool added a commit to code-n-cool/social-community that referenced this issue May 10, 2024
More information on the issue this is working around:

Lucas-C/pre-commit-hooks#83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants