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
Add documentation on how to use the identity hook #2180
Comments
no files to check means that nothing has matched your filters so it's not even getting to the call because you've filtered out all the files |
|
|
my guesses:
|
I was running
Ah, that's what i'm doing wrong. Once I modified a typescript file, it worked correctly. See, the documentation says:
But in my case, I need to execute the pre-commit script in a subdirectory. Therefore, the term
Perhaps you are correct, but I think it would help if verbose gave more information along the lines of #2179 If verbose told me somewhere it is looking for staged files, I would've instantly known what I was doing wrong. I think that would be more valuable than the documentation saying it, as the documentation is ~8500 words, and as far as I can tell, only a few of those words are used to explain this -- and they are wrapped in parentheses, so they are easy to pass by. In my experience, verbose flags usually provide troubleshooting information, but for |
yeah, I guess I expected you to have gone through the quick start and understood the basics |
Well, actually I did. Not just this time, but a couple of months ago, too. Perhaps the first time I noticed the comment in the parentheses, and maybe this time I missed it. Or maybe I missed it both times, I can't remember. Regardless, am I too take this as you're not interested in adding troubleshooting information to |
correct I do not want to expose the internals plus there are existing and established mechanisms for getting the same information |
I'm still a little confused about that. I just changed my configuration file to look like this (notice how I removed the repos:
- repo: meta
hooks:
- id: identity
name: Firebase Identity
language: system
pass_filenames: false
types: [ts]
files: ^firebase/functions/.*
- repo: local
hooks:
- id: firebase-formatter
name: Firebase Formatter
language: system
entry: bash -c 'cd firebase/functions && echo "$PWD"'
pass_filenames: false
types: [ts]
files: ^firebase/functions/.* And when I ran the command line, this was its output:
What information is identity supposed to provide? Perhaps when you said, "there are existing and established mechanisms for getting the same information," you were referring to something that hasn't been brought up yet? |
Oh, it might help to look at my git status:
|
that would show you that there were no arguments passed to your hook -- if you remove I am a little confused about your output -- it seems to have parts missing -- I expect: $ pre-commit run firebase-formatter -v
Firebase Identity........................................................Passed
- hook id: identity
- duration: 0.03s
Firebase Formatter.......................................................Passed
- hook id: firebase-formatter
- duration: 0s
/path/to/your/repo/firebase/functions
|
Ah, that makes sense.
Oops, my bad. Something like that is on the last line. Thanks for all the help with this. I understand your reasoning for not wanting to add more information to -v, but what would you think about an example of using the identity hook correctly? I could submit a PR for it if you want. |
describe your issue
Based on the advice I received from #2179 I tried to add an identity hook to my script to troubleshoot why my configuration isn't working as expected.
This is the output of running
pre-commit
:I'm sure I'm not using this correctly, but there are no examples showing the right way to use this hook. I'd like the documentation to include an example.
pre-commit --version
pre-commit 2.16.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
This file didn't exist.
The text was updated successfully, but these errors were encountered: