I'm certain this must have been suggested before but I can't find it. I would like an equivalent of eslint --fix that automatically fixes issues where possible.
I know one of the things that credo tries to do is behave as a teaching tool - so fixing issues for the student automatically might be considered cheating slightly! However, I think there are some good counter points to that:
Sometimes we just need to get s*** done. Having the tool automate code consistency for us where possible is a bonus.
Many of the suggestions that credo returns are menial (no brackets on zero-arity functions for example - I get it, and I like the enforcement of consistency, and I've "learnt" (honest) but I'd really like to have the machine just automate that for me.
I'm sure it could be combined with the existing teaching features so that it encourages learning while also being helpful and fixing things up.
Which existing behaviour would change?
I imagine this being introduced as a new CLI flag, like --fix perhaps. Credo would then output the same helpful information about each problem found, and then it would fix it automatically somehow. It'd then be up to the user to review the changes and commit if they wish.
Users already running credo would not experience a change in behaviour unless they opt in by specifying the --fix flag.
Plugin support
In researching this issue I just learnt that credo supports plug-ins. Does an existing plug-in exist? Would it be possible to implement such a behaviour as a plug-in?
What do you want Credo to do?
I'm certain this must have been suggested before but I can't find it. I would like an equivalent of
eslint --fix
that automatically fixes issues where possible.I know one of the things that credo tries to do is behave as a teaching tool - so fixing issues for the student automatically might be considered cheating slightly! However, I think there are some good counter points to that:
Which existing behaviour would change?
I imagine this being introduced as a new CLI flag, like
--fix
perhaps. Credo would then output the same helpful information about each problem found, and then it would fix it automatically somehow. It'd then be up to the user to review the changes and commit if they wish.Users already running credo would not experience a change in behaviour unless they opt in by specifying the
--fix
flag.Plugin support
In researching this issue I just learnt that credo supports plug-ins. Does an existing plug-in exist? Would it be possible to implement such a behaviour as a plug-in?