nshki / chusaku

Annotate your Rails controllers with route info.
https://rubygems.org/gems/chusaku
MIT License
87 stars 4 forks source link

More informative messages for CI #20

Closed zverok closed 3 years ago

zverok commented 3 years ago

Hi! Happy to say we use Chusaku daily and it really makes our lives better :)

We set our CI to run chusaku --dry-run --exit-with-error-on-annotation, so it notifies us if we forgot to annotate some routes.

One thing that recently came to my attention is that if some developers on the team aren't familiar with chusaku use case, they are confused by CI error that just says "Annotated controller/path.rb", doesn't look really "error-y"... WDYT about expanding it to say something like this (on dry-run, for example):

Annotation comments are missing in the following controllers: .... Run chusaku command locally to add annotation comments.

(Or, alternatively, there could be a command-line argument to provide custom error message... But I believe the message above would be helpful for all chusaku users.)

nshki commented 3 years ago

Thanks for raising this! It makes me really glad to hear the gem is helpful for you and your team.

This is a really great suggestion for a critical touch point. Having clear copy that accompanies each flag makes total sense. Piggybacking off of your suggestion, how does something like this seem?

Running with —dry-run

The following files would be annotated without —dry-run: ...

Running with —exit-with-error-on-annotation

Annotated ...

Exiting with status code 1.

Running with —dry-run —exit-with-error-on-annotation

Annotations missing in the following files: ...

Run chusaku to annotate them. Exiting with status code 1.

zverok commented 3 years ago

how does something like this seem?

This would be absolutely awesome and clear.