ec4j / editorconfig-linters

A set of language specific linter implementations
2 stars 6 forks source link

Feature request: Java files formatting #23

Open maciejwalkowiak opened 1 year ago

maciejwalkowiak commented 1 year ago

Currently the only linter that processes Java files is TextLinter that does not take indent_style and indent_size into consideration. Is there a s specific reason for that? I tried to use editorconfig-maven-plugin but since it formats only the pom.xml in case of my project I struggle to find practical use case for it.

Related: https://github.com/ec4j/editorconfig-maven-plugin/issues/66

ppalaga commented 1 year ago

The problem is that indent_style and indent_size are not enough to write a complete Java linter. editorconfig being a bit monolithic, it would be rather hard to add everything needed. There is an open issue for namespacing https://github.com/editorconfig/editorconfig/issues/332 and also for Java formatting props: https://github.com/ec4j/editorconfig-java-domain I admit I ran out of time for doing this a couple of years ago and I actually do not feel a need for this anymore since I started using net.revelc.code.formatter:formatter-maven-plugin for formatting java.

maciejwalkowiak commented 1 year ago

@ppalaga thanks for quick answer. I've been using Spotless but I see benefit of .editorconfig as it can format all types of files. That being said I also won't find time for submitting PR here, so either this issue stays open to see if any 👍 come or feel free to close it in favor of other related open issues.