AutoRefactor icon indicating copy to clipboard operation
AutoRefactor copied to clipboard

Allow to run AutoRefactor in headless mode

Open JnRouvignac opened this issue 10 years ago • 17 comments

This would allow running AutoRefactor from command line or from external tools like maven, ant, gradle, etc. as plugins/tasks.

JnRouvignac avatar Mar 02 '15 23:03 JnRouvignac

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:

JnRouvignac avatar Jun 17 '15 20:06 JnRouvignac

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.

JnRouvignac avatar Jun 18 '15 07:06 JnRouvignac

See https://wiki.eclipse.org/SWTBot/Automate_test_execution#Command-line for how to do it.

JnRouvignac avatar Sep 19 '16 15:09 JnRouvignac

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.

cal101 avatar Mar 16 '17 18:03 cal101

I am interested in a cli version of autorefactor, too. It would be great if you'd share it with us!

simsieg avatar Apr 04 '17 10:04 simsieg

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!

luiscruz avatar Apr 04 '17 10:04 luiscruz

Are https://github.com/JnRouvignac/AutoRefactor/issues/148 and https://github.com/JnRouvignac/AutoRefactor/commit/6705113a055cea41053d5a162998dce17fc2dbae related to this issue?

jbduncan avatar Jul 08 '17 05:07 jbduncan

#148 is probably a good thing for this issue but it's not enough.

Fabrice-TIERCELIN avatar Jul 08 '17 07:07 Fabrice-TIERCELIN

@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!

cal101 avatar Jul 21 '17 21:07 cal101

Thanks for taking the effort to look into this @cal101; looks interesting! :+1:

jbduncan avatar Jul 21 '17 22:07 jbduncan

@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. :)

jbduncan avatar Jul 21 '17 22:07 jbduncan

I know about pull requests. It's far from being pullable.

cal101 avatar Jul 21 '17 22:07 cal101

Hmm... wouldn't it be pullable if you moved your work over to a new branch and PR-ed it against master?

jbduncan avatar Jul 21 '17 22:07 jbduncan

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.

cal101 avatar Jul 21 '17 22:07 cal101

Fair 'nuff. :+1:

jbduncan avatar Jul 21 '17 22:07 jbduncan

@JnRouvignac I wonder if you know whether there's been any progress made on this issue recently? :)

jbduncan avatar Feb 07 '18 23:02 jbduncan

No idea really. cal101 is the one driving this on his own :)

JnRouvignac avatar Feb 08 '18 08:02 JnRouvignac