Extract the IDEA Java code formatter to own library?

Hey there,

we want to format our Java code on Git commit. This doesn't work with IDEA alone since we cannot exclude certain file types (and a few team members don't use IDEA).

So since the IDEA Community code is open source we'd like to create a little library "jfmt" that we could call on Git commit.

Could you give me some pointers where to start looking in the big repository to find what I need?

Regards
Stephan

6 comments
Comment actions Permalink

Why not to use eclipse formatter? It can do it.

0
Comment actions Permalink

For a different reason I am interested in this also.

0
Comment actions Permalink

I'm still a bit lost on how to format a bunch of files without starting an entire IDE ... anyone?

0
Comment actions Permalink

I would take a look into com.intellij.psi.formatter.java.AbstractJavaFormatterTest

0
Comment actions Permalink

I will. Thank you very much :)

0

Please sign in to leave a comment.