You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add statistics information for individual checks (especially time of execution) #1144
I would love to have an option to add some statistics to be displayed for each check. This could be very useful for running pre-commit in CI. I had a case recently of a check that run accidentally a bit longer than expected (it was building unnecessary docker image) and I have not realised that it is taking longer - because we had other checks after and I could only see the total execution time.
Also some other useful information that we might see is how many parallel processes were run and how many files were passed as parameters. This might be really useful especially for people who do not understand that pre-commit runs in parallel by default - this can have some undesireable side effects if you forget to set "require_serial" to True when you need. And seeing that in the output of CI might immediately show that something is wrong. For now the output is a bit of "black-box".
An option to see some additional information (--add-statistics) might be super-useful.
Example output I imagine (maybe a bit better aligned):
Check if image build is needed...........................................Passed [23.5s, 1 process, no-files]
Add licence for all JINJA template files.................................Passed [2.25s, 8 processes, 48 files]
Check Shell scripts syntax correctness...................................Passed [6.00s, 8 processes, 10 files]
Lint dockerfile..........................................................Passed [2.20s, 3 processes, 3 files]
Run mypy.................................................................Passed [12.00s, 8 processes, 1456 files]
Run pylint for main sources.............................................Skipped
Run pylint for tests....................................................Skipped
Run flake8...............................................................Passed [24.05s, 8 processes, 1456 files]
Reacted by David, Danny Staple and Tony Gentilcore
verbose is .... far too verbose. It's great to see only "passed" but then having some stats, would make it also actionable for cases that are "valid properties" of the check rather than just passed/failed status. Most of the UnitTest frameworks have such feature to display for example the timing.
And it is perfectly ok to have a separate switch for that and do not have it in the output by default. I think it might be really useful for the CI case I described.
I think it might be useful for local pre-commits as well, but the main usage scenario for this flag I foresee for CI case. We are currently using it with --all-files --show-diff-on-failure and it works great (minimum output + we see exact diffs when diff-failure happens).
In this case I only found out that we have a problem because the build steps were running for a really long time and failed (but I would immediately see the problem if I had the stats).
In my particular case we have the "build needed check" (see the #1143 ) and when it does not need to rebuild the image it will be "passed" in ms. But if (happened in my case) due to bug in build need detection it took maybe 2-3 minutes. - I would immediately see this with statistics but in case of our build the only thing i could see is "passed" without knowing how much time this particular check took.
BTW. I have found that having CI build for pre-commit is great promotor of pre-commit in general - because when something fails, installing pre-commit and running that failed check is simplest way to do (and pre-commit nicely suggests that action). But CI is also good to observe if other build properties are met.
Activity
potiuk commentedon Sep 22, 2019
Happy to contribute it if there is an agreement to add it :)
asottile commentedon Sep 22, 2019
the output is intentionally quiet and I don't want to change that, your proposal also makes things no longer line up
maybe just add this to verbose if at all ?
potiuk commentedon Sep 22, 2019
verbose is .... far too verbose. It's great to see only "passed" but then having some stats, would make it also actionable for cases that are "valid properties" of the check rather than just passed/failed status. Most of the UnitTest frameworks have such feature to display for example the timing.
And it is perfectly ok to have a separate switch for that and do not have it in the output by default. I think it might be really useful for the CI case I described.
asottile commentedon Sep 22, 2019
I don't want a combinatoric explosion of options, especially ones I'm not going to use
asottile commentedon Sep 22, 2019
if it's only for CI who cares how verbose it is?
potiuk commentedon Sep 22, 2019
I think it might be useful for local pre-commits as well, but the main usage scenario for this flag I foresee for CI case. We are currently using it with
--all-files --show-diff-on-failureand it works great (minimum output + we see exact diffs when diff-failure happens).In this case I only found out that we have a problem because the build steps were running for a really long time and failed (but I would immediately see the problem if I had the stats).
In my particular case we have the "build needed check" (see the #1143 ) and when it does not need to rebuild the image it will be "passed" in ms. But if (happened in my case) due to bug in build need detection it took maybe 2-3 minutes. - I would immediately see this with statistics but in case of our build the only thing i could see is "passed" without knowing how much time this particular check took.
BTW. I have found that having CI build for pre-commit is great promotor of pre-commit in general - because when something fails, installing pre-commit and running that failed check is simplest way to do (and pre-commit nicely suggests that action). But CI is also good to observe if other build properties are met.
asottile commentedon Sep 23, 2019
I don't want another option, let's add it to verbose output
blueyed commentedon Nov 22, 2019
asottile commentedon Nov 22, 2019
please read the discussion -- I've already said no to that
blueyed commentedon Nov 22, 2019
asottile commentedon Nov 22, 2019
please stay on topic, thanks
blueyed commentedon Nov 22, 2019
34 remaining items
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)
[AIRFLOW-XXXX] Increease verbosity of static checks in CI (#7200)