Perfexionists / perun

Lightweight Performance Control System
GNU General Public License v3.0
16 stars 14 forks source link

Add option for user to initialize perun and git if Perun is run from outside of perun scope #177

Closed tfiedor closed 8 months ago

tfiedor commented 8 months ago

This PR partly reworks the way NotPerunRepositoryException is handled for CLI commands.

If the exception is raised, then the user is prompted whether he/she/they wants to initialize .perun together with .git. If there is no .git in the current working directory, an empty root commit is created (using git commit --allow-empty -m "root"). This is temporary solution, which will be replaced by lightweight VCS, that will be developed in near future.

Also this PR rework or fixes:

  1. Fixes nondeterministic bug in tests (due to setting no paging)
  2. Extracts confirmations from user to isolate function
  3. Adds support for suppresing user prompts by --say-yes option.
  4. Fixes minor issue in Logger.
codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (27ac30f) 98.73% compared to head (be81074) 98.74%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## devel #177 +/- ## ======================================= Coverage 98.73% 98.74% ======================================= Files 131 131 Lines 8539 8573 +34 ======================================= + Hits 8431 8465 +34 Misses 108 108 ``` | [Flag](https://app.codecov.io/gh/Perfexionists/perun/pull/177/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Perfexionists) | Coverage Δ | | |---|---|---| | [coverage-3.10](https://app.codecov.io/gh/Perfexionists/perun/pull/177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Perfexionists) | `98.71% <100.00%> (+<0.01%)` | :arrow_up: | | [coverage-3.11](https://app.codecov.io/gh/Perfexionists/perun/pull/177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Perfexionists) | `98.69% <100.00%> (+<0.01%)` | :arrow_up: | | [coverage-3.9](https://app.codecov.io/gh/Perfexionists/perun/pull/177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Perfexionists) | `98.72% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Perfexionists#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.