-
Notifications
You must be signed in to change notification settings - Fork 52
Make Makefile argument optional for easier use from tools. #81
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
Conversation
|
According to the pre-commit documentation for adding new hooks the default is not to run hooks when there are no files to be checked and the checkmake hook configuration does not override this, so I am not really sure why this is helping, but it has. |
|
Can you show the output you're seeing when it fails? I've used checkmake at rev c047d51 for many months now without a problem across more than a dozen repos. |
|
it would be good to have a more detailed description here of what exactly fails and how this is fixing it. Especially since there are reports where things are working. |
Alternative perspectivethe pitchConversely to making the need to specify a file (e.g., the path to a makefile) to scan/lint an option, I'd suggest adding an option to search/find obvious makefiles, such as files named "[mM]akefile" or ending with ".make" or with ".makefile" (and of-course accept an optional custom argument for users to specify glob patterns). TL;DR - some risks
example (hint for regression testing): MAKE_FILES=$(git ls-files --exclude-standard -- includes/enable_*.make 2>/dev/null) # assume the expected matches are not on the current branch (no enabled includes)
checkmake $MAKE_FILES # currently will fail due to no valid paths
exit $? # pass the pass/fail to callerHowever if made optional the example case would change behavior to no-longer fail just because Thanks for reading this far, |
|
@michael-delarue-axomic , as @mrtazz has already requested, could you please describe with some level of detail, what exactly is the problem that this PR is intended to fix? I. E., please give a precise description of and steps to reproduce the issue. |
|
@michael-delarue-axomic also, the change looks simple enough but I can't really see what behavior changes it introduces. Could you add example invocations with and without the patch with different results? |
|
rebased on current |
The branch update button created a merge commit which makes no sense IMHO. So I creaded a clean rebase locally and updated the PR.
|
obnoxxx
left a comment
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.
I still don't really understand the purpose of this change but the patch is clean and the change does not impact behavior negatively for me, so I think we can just take it without further ado.
LGTM.
This seems to solve problems with running checkmake from pre-commit. It very simply makes the Makefile argument optional which means that checkmake doesn't seem to run.
(see also #80 and some comments on other (closed) issues (e.g. #69)
Checklist
Not all of these might apply to your change but the more you are able to check
the easier it will be to get your contribution merged.
no unit test yet since this basically does nothing. Might investigate learning how to do that if considered worthwhile.