[erlang-questions] Safer, functional version of erl_tidy
Richard Carlsson
carlsson.richard@REDACTED
Fri May 31 09:39:15 CEST 2013
On 2013-05-30 16:24 , Andrew Pennebaker wrote:
> I like what erl_tidy recommends about changing my code, but I don't like
> how it enacts the changes automatically. Could the next version default
> to outputting warnings, a la hlint, splint, jshint, etc., leaving the
> decision of what to tidy up to the programmer? We could keep automatic
> tidying as a flag in erl_tidy:dir/2.
That flag already exists. Pass {test, true} (or just the atom 'test') in
the options, and erl_tidy will do a dry run.
> Also, it would be convenient to have a shell command, maybe elint or
> such, so that you don't have to erl -noshell -s erl_tidy dir <dir> -s
> init stop.
I'm not sure it's used often enough to warrant making it a separate
command, like e.g. dialyzer. You could easily make a shell script
wrapper for it though.
I haven't done any work on erl_tidy for a decade; it was mainly intended
as a way to easily find (or even automatically get rid of) old
deprecated idioms, such as the old-style guards. Kostis Sagonas and his
students took the concept further and made "tidier", which can do a lot
more than erl_tidy, and even has a graphical interface to step you
through the suggested changes:
http://tidier.softlab.ntua.gr:20000/tidier/getstarted
It hasn't been released as open source though.
/Richard
More information about the erlang-questions
mailing list