NorfairKing / feedback

Declarative feedback loop manager
https://cs-syd.eu/posts/2022-11-14-automate-your-feedback-loops-using-feedback
GNU General Public License v3.0
61 stars 10 forks source link

feature request: corrections #19

Closed locallycompact closed 1 year ago

locallycompact commented 1 year ago

some feedback loops have straightforward correcting commands that could be defined in the data for the loop itself. The idea here is you get a menu like

       > Found errors with nixpkgs-fmt, try running /nix/store/n2h8p3xgn2fp1k6a8lkr59qfskzva46z-lint/bin/lint
       For full logs, run 'nix log /nix/store/610csvkw8h9wwr7l2bz080g779lv70gh-nixpkgs-fmt.drv'.
12:51:52 exited:    failed: 1
12:51:52 took       5.59s

Press to correct:

[0]: nixpkgs-fmt
[1]: stylish-haskell

If you press the appropriate key in the terminal running feedback then the command is executed for you and the feedback loop rerun

defined something like

loops:
  check:
    command: nix flake check -L
    corrections:
      nixpkgs-fmt:
        key: 0
        command: find . -name '*.nix' | xargs nixpkgs-fmt
NorfairKing commented 1 year ago

This idea is bloody amazing, but how would feedback know which corrections to suggest? Or do you just suggest all of them every time?

locallycompact commented 1 year ago

Yes it would be a dumb menu that just offers lots of buttons.

NorfairKing commented 1 year ago

PR welcome