AutoRefactor
AutoRefactor copied to clipboard
Allow to run AutoRefactor in headless mode
This would allow running AutoRefactor from command line or from external tools like maven, ant, gradle, etc. as plugins/tasks.
A very interesting use case would be to provide automatic comments in code reviews (or when browsing code).
See Google's research paper "Tricorder: Building a Program Analysis Ecosystem". This can also be used as a means to get feedback on the refactoring rules.
Here are APIs to do it:
- Atlassian Crucible
- Github
- Gerrit? Rest or plugin API?
From Google's research paper "Tricorder: Building a Program Analysis Ecosystem":
There are other potential integration points for program analysis. Many IDEs include a variety of static analyses. However, most Google developers do not use IDEs, or do not use IDEs for all tasks [38] – making IDE-only integration untenable.
See https://wiki.eclipse.org/SWTBot/Automate_test_execution#Command-line for how to do it.
I hacked on a command line frontend last year but I didn't update it since 2016/02. If there is any interest I can make it runnable again and put it on github. It's not finished but command line parameters are passed and evaluated the eclipse project to use and and some fixed sets of refactorings are triggered by those. Could be used as a starting point.
I am interested in a cli version of autorefactor, too. It would be great if you'd share it with us!
Such feature would be really useful. It would make it easier to use autorefactor in different development environments :) Not sure if there's an easy solution though!
Are https://github.com/JnRouvignac/AutoRefactor/issues/148 and https://github.com/JnRouvignac/AutoRefactor/commit/6705113a055cea41053d5a162998dce17fc2dbae related to this issue?
#148 is probably a good thing for this issue but it's not enough.
@cal101 It took me some time but I finally managed to cleanup the code enough to be runnable.
Please give it a try: https://github.com/cal101/AutoRefactor
There is a lot of integration work with maven needed and there are a lot of rough edges and hacks. I just used a linux shell script instead. And here are a few TODOs, too: https://github.com/cal101/AutoRefactor/blob/cli/cli/TODO.txt
I don't know much maven and if someone can improve on this: please provide fixes!
Thanks for taking the effort to look into this @cal101; looks interesting! :+1:
@cal101 Your effort would probably be best presented as a Pull Request, if you know how to do one of those. That way, people are more likely to find it and give feedback on it. :)
I know about pull requests. It's far from being pullable.
Hmm... wouldn't it be pullable if you moved your work over to a new branch and PR-ed it against master?
It's technically pullable (git) but the content is not ready for integration into master. Just too many issues at the moment. Code base is current master. When it is ready it will get it's pull request. There is no big difference with having a separate repo. clone it, build it, run it, open issues and provide fixes.
Fair 'nuff. :+1:
@JnRouvignac I wonder if you know whether there's been any progress made on this issue recently? :)
No idea really. cal101 is the one driving this on his own :)