-
Notifications
You must be signed in to change notification settings - Fork 143
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
Allow pre-commit
to run in subpath
#2007
Conversation
/packit test |
Well at least the tests are happy so far, although there are no tests written for this. Can I leave writing these tests to the others? I'll just push a quick fix for RHEL8 builds when the tests are done. Ok so pre-commit test failed 🤔
|
@lukaszachy I will need some help on this. Locally when I test I get appropriate failures, but tmt seems to detect a fmf root from somewhere. And it is not like I am using #2008 here. Is it because I am not using local file url for the context url? |
/packit test |
@happz There are no other PRs that could help with the tests for this right? The failed test is very bizarre to me, i.e. where is the fmf root detected over there? |
I'm not aware of any lint-related PRs other than #1851. WRT the failed test, no idea, TBH, it's the first time I see the pre-commit hooks in action. Maybe @lukaszachy could help. |
Anyway, I have added the tests for the fmf_root. Can someone trigger the tests again? |
/packit test |
I'm sorry, not that much time for pre-commit stuff. The idea behind that test is that it is common to forgot to include The test assumes fmf root == git root. For some use cases this is required (e.g. fedora/centos where plans are detected from git root) for others (e.g. this PR) not so much. So we will need additional test to check that pre-commit finds issues if fmf-root option is used and no such root exists. |
Makes sense, so the issue is that my wrapper here still detects the current path's
Maybe I just run |
The python script outpus absolute path to the fmf root so
I'm afraid that it can be false positive - If the 'path' is set to say But we might have easier life: Use |
I don't get this one, maybe we are missing each other point. What I was thinking of doing is effectively:
(being wrapped into
Thanks I was just thinking about how to get git root to pass it there in the above. |
Cool, this should work. I got confused because in fmf id the 'path' is part between git root to the fmf root. Too many 'path's |
Ok, 7104337 should fix the issue. Am I missing anything else? |
/packit test |
Yey, tests are passing :) |
1af2b6b
to
d10f735
Compare
pre-commit
to run in subpath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just hide the --pre-check
option, lgtm otherwise. It would be nice to have a dedicated tmt subcommand but as you mentioned it would require much more refactoring which is IMO not worth it.
/packit build |
@LecrisUT when you have a moment, rebase, please, there seem to be conflicts. |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
/packit build |
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
/packit build |
Unrelated issues reported by tests, as far as I can tell. And all conversations seem to be resolved, merging. |
Took some mucking around, but I've finally got something half-decent approach. It almost works other than #2006. Here is an example for testing:
Fixes: #2004