-
Notifications
You must be signed in to change notification settings - Fork 16.3k
When precommits are run, output is silenced #10390
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
When precommits are run, output is silenced #10390
Conversation
4affc3c to
f6ece9a
Compare
f6ece9a to
cc8e290
Compare
|
@mik-laj -> this one nicely fixes the output of pre-commits locally and GitHub actions so that no extra stuff is visible. Still it keeps pre-commit spinner /progress running as well as handles well VERBOSE flag. And I switched to using aliases for docker/kubectl everywhere where I can (aliases do not work in pre-commits as they are not interactive) Of course erors are printed on pre-commit :) |
a85b7fd to
d337483
Compare
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from apache#10368
d337483 to
ff4b32e
Compare
| if [[ -n ${SPIN_PID:=""} ]]; then | ||
| kill -HUP "${SPIN_PID}" || true | ||
| wait "${SPIN_PID}" || true | ||
| echo > "${DETECTED_TERMINAL}" |
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.
What values can the variable DETECTED_TERMINAL have? I can see that this variable is always set to /dev/tty. Did I miss something?
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.
it can be /dev/tty if we cannot detect therminal with $(tty) (which happens inside pre-commit on git commit (it is always non-interactive by design)
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.
it can be /dev/tty if we cannot detect therminal with $(tty) (which happens inside pre-commit on git commit (it is always non-interactive by design)
elif [[ ${DETECTED_TERMINAL:=$(tty)} != "not a tty" ]]; then
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.
The whole thing is about trying to print progress to most likely terminal i fbuild happens insde pre-commit inside `git commit command - it won't always succeed but in vast majority of cases of developer workstation - it will
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from apache#10368 (cherry picked from commit 77a635e)
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from apache#10368 (cherry picked from commit 77a635e)
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from #10368 (cherry picked from commit 77a635e)
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from #10368 (cherry picked from commit 77a635e)
The output of pre-commit builds on both CI and locally is now limited to only show errors, unless verbose variable is set. We are utilising aliases if possible but in case of pre-commits they are run in non-interactive shell which means that aliases do not work as expected so we have to run a few functions directly in other to show spinner. Extracted from apache#10368 (cherry picked from commit 77a635e)
The output of pre-commit builds on both CI and locally
is now limited to only show errors, unless verbose
variable is set.
We are utilising aliases if possible but in case of
pre-commits they are run in non-interactive shell which
means that aliases do not work as expected so we have
to run a few functions directly in other to
show spinner.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.