rpau / javalang-compiler

Java compiler elements (symbol and type tables) to perform code semantic analysis
GNU Lesser General Public License v3.0
10 stars 4 forks source link

Formatter config #66

Closed cal101 closed 7 years ago

cal101 commented 7 years ago

Dear Raquel!

I am sorry for the formatter obstacles. I tried to translate the formatting config I am familiar with from the gradle formatter to a maven formatter I was not familiar with and I was not good enough.

This pull requests takes a totally different approach: Maven calls out to gradle via plugin to execute the gradle plugin "spotless" that does the formatting and also removes unused imports. This uses the formatting utils I am familiar with but does not need a gradle installation or migration.

The changes compared to the previous configuration: see https://github.com/cal101/javalang-compiler/commit/b5be5fd8a5c679e23599c680e811f1c55ebf7c2d

Execute the formatter via

mvn org.fortasoft:gradle-maven-plugin:invoke

The result can also be see here: https://github.com/cal101/javalang-compiler/commit/240eda04a0bb6e90bbc0cd4d3d90a9680f00aecc

To see the real differences it's best to call the formatter in your own workspace and apply it and then compare with "git diff -w" to ignore whitespace.

I hope this helps.

Cal

cal101 commented 7 years ago

Some fine tuning and fixing of import order config done.