[Question] Running code formatter

7 views
Skip to first unread message

timofey.chudakov

unread,
Mar 7, 2020, 3:31:17 PM3/7/20
to jgrapht-dev
There's currently a PR for transit node routing. It was rebased onto master branch in order to be able to generate javadoc (the JVM was changed in this release, so there were problems with obsolete javadoc tags). 

However, this action retained old code style in the changed files. 

Question: how do we run code formatter? This is needed in order not to reset the code style manually 

Joris Kinable

unread,
Mar 7, 2020, 4:03:19 PM3/7/20
to timofey.chudakov, jgrapht-dev
I'd recommend to merge the code (if possible) without running the code formatter. The code formatter is currently problematic. It relies on Eclipse, but the latest version of Eclipse contains a bug that prevents you from running the formatting tool (this is a known bug). The only way around is to work with an older version of Eclipse, but that requires that you also install an older java version as the older versions of Eclipse cannot work with Java 11 or above...

In general there are 2 ways to run the formatter:
(1) load org.eclipse.jdt.core.prefs (in the jgrapht/etc folder) into eclipse and run the formatting from within eclipse
(2) run codeFormatter.sh (in the jgrapht/etc folder). The latter requires adjusting some paths. Make sure you exclude changes to codeFormatter.sh whenever you commit your code



--
You received this message because you are subscribed to the Google Groups "jgrapht-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jgrapht-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jgrapht-dev/69f08b4e-d555-4736-b11f-77dad760c211%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages