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

0
6 comments

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

0
Avatar
Permanently deleted user

For a different reason I am interested in this also.

0
Avatar
Permanently deleted user

Well, you'll find my attempt here: https://github.com/SmallImprovements/jfmt

0
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

I will. Thank you very much :)

0

Please sign in to leave a comment.