elm-analyse
elm-analyse copied to clipboard
Allow fixing a whole file or project
This came about from integration with the language server so that we could have a "Fix all issues in this file" action, it seemed like it would be nice to have in the CLI tool, so I also added some options for that.
- To fix a single file:
elm-analyse --fix src/Main.elm
orelm-analyse -f src/Main.elm
- To fix an entire project:
elm-analyse --fix-all
- Less verbose logging when running in CLI mode, it now replaces the output of each line for info messages, and prints other messages on newlines. I'm not sure if belongs along with this PR, if you aren't a fan I can remove it :)
When fixing a file it will apply a single fix, then re-analyze the file, and apply the next fix. I tried fixing files from the bottom up, but ran into issues when there were multiple issues on one line, like in an import list with a few unused variables.
Can we move this forward?
My colleague came across the fix-all
flag by finding & running the install from his vim/language-server setup. It allowed us to use elm-analyse to quickly fix 600/750 errors we had automatically and was a life-saver for speeding up adoption in the code base.
Hi @antew I am confused, I've installed elm-analyse from your branch and neither the --fix or the --fix-all flag seem to have any effect.