-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
.pre-commit-config.yaml file created by nitpick doesn't have the rev key #472
Comments
Hey, thanks for the bug report! TL;DR: the absence of the Read further below for more details. Possible solutionThis problem should be fixed when #218 will be developed.
Why the
|
Hi @andreoliwa, thank you for proposing the solutions and for the explanation. I think using numbers 2 and 3 will solve this problem. I didn't know about |
Awesome that these items unblock you. 🥳
Good idea, I'll do that. 👍🏻 |
First of all, great project! Just want to say that I used the following layout [[".pre-commit-config.yaml".repos]]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "" # run `pre-commit autoupdate` Which worked well as a placeholder. Not sure if there are any downsides with this though! |
Hi y'all! I'm also running into this issue, and the proposed solution with # nitpick style
[nitpick.files.present]
".pre-commit-config.yaml" = "Create the file with the contents below, then run 'pre-commit install'"
[[".pre-commit-config.yaml".repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
[[".pre-commit-config.yaml".repos.hooks]]
id = "ruff" Trying to run it on a repo without the $ nitpick fix
.pre-commit-config.yaml:1: NIP103 should exist: Create the file with the contents below, then run 'pre-commit install'
.pre-commit-config.yaml:1: NIP361 was not found. Create it with this content:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
hooks:
- id: ruff
Violations: ✅ 1 fixed, ❌ 1 to change manually.
$ nitpick fix
No violations found. ✨ 🍰 ✨
$ pre-commit autoupdate
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='https://github.com/astral-sh/ruff-pre-commit')
=====> Missing required key: rev
Check the log at /home/valberg/.cache/pre-commit/pre-commit.log
|
Maybe it works if you add
You're correct. This still depends on #218 being developed first as I mentioned in #472 (comment).
@AntarktisZ11 Currently, if the style has |
I updated the docs: https://nitpick.readthedocs.io/en/latest/troubleshooting.html#missing-rev-key-when-using-the-default-pre-commit-styles |
Expected behavior
After running,
nitpick fix
, a.pre-commit-config.yaml
file was created. I expect to see the required keyrev
under all repos.Current behavior
No key
rev
is shown in the.pre-commit-config.yaml
file. Here is how the file looks like:Steps to reproduce
Run
nitpick fix
created a.pre-commit-config.yaml
fileContext
I can't commit because of the missing required key
rev
. Here is the messing I saw when committed:Your environment
nitpick
version used: 0.31.0The text was updated successfully, but these errors were encountered: