Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: TFLint: Add
--hook-config=--delegate-chdir
to usetflint -chdir
#512feat: TFLint: Add
--hook-config=--delegate-chdir
to usetflint -chdir
#512Changes from 2 commits
da201ba
0725e70
7e5bda4
5dc58c4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 don't like that it makes
common::per_dir_hook
more complex.I thinking about moving it to a separate function but I don't see how it could be done, at least, without introducing a new global env.
The main problem here is
pushd/popd
IF's,which, in current realization (internal variable naming?) looks too "tflint-specific"
I suppose
CHANGE_DIR_INSIDE_HOOK
thanDELEGATE_CHDIR
will be more universal and easier to understandThere 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.
Or at least, I have those feelings. Not sure how they could be properly described and, which more importantly, done via code.
Let me think about it for a few days (and test how that functional could works with other hooks), maybe then I can describe it better
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 like the
delegate
wording. IfDELEGATE_CHDIR
is too short for clear understanding, thenDELEGATE_CHDIR_TO_HOOK
should suffice imho.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.
Parse
HOOK_CONFIG
array outside of the function and define this function with or w/opushd/popd
things based on presence or absence of--delegate-chdir
hook arg and its value 😜This may be expanded later for alike use cases. Though this would add complexity to the code anyways.
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'd leave this as is (the way it's coded by @lexton in this PR) as a one-off/unique instance, at least until we have more of this kind requested.
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 think its relatively well encapsulated as is.
If you wanted to change/extend this in the future it wouldn't be too hard to update/change variable wording without major impact.
The biggest thing that would be hard to change would be the exact flag name.
--delegate-chdir
if you wanted to make this more future proof that makes sense to get correct right now.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.
My opinion for the flag is the same as for the var naming. JFYI.
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.
Okay, I double-checked #508 and this functional does not help avoid the mentioned issue, so, I'll make one tiny improvement and we are ready to go