Skip to content

Better CLI #288

Closed
Closed

Description

@lorenzwalthert

I propose:

  • Use the cli package to create nice ticks next to the styled files instead of the red, aggressive [DONE] if the styling did not change, an info icon if the styling changed and an warning icon if the styling failed. At the end of the styling, we can add a summary. Just like this:
Styling  1  files:
 test-start_line.R ✔ 
────────────────────────────────────────
Status	Count	Legend 
✔ 	1	File unchanged.
ℹ 	0	File changed.
✖ 	0	Styling threw an eror.
  • Ideally we would also add one of the circling dots but I have not figured out how to do that quickly. Maybe you @krlmlr know how that works form testthat?
  • Instead of a logical vector, style_file() and friends should (invisibly) return a tibble that contains the paths to the files as well.
return_value
#> # A tibble: 1 x 2
#>                               file changed
#>                              <chr>   <lgl>
#> 1 tests/testthat/test-start_line.R   FALSE

Any further suggestions @krlmlr?

Activity

  1. krlmlr commented on Nov 27, 2017

    @krlmlr
    Member

    I think cli::demo_spinners() gives a good starting point for the circling dots. We need:

    • An object with state that keeps track of the spinner status, and maybe the time at which to update the display
    • A function which we call "often enough" (maybe in the visitor) that updates the spinner as necessary
    • A way to turn spinner display on and off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions