Plugin to generate formatting settings for IDE basing on checkstyle settings and vice versa

108 views
Skip to first unread message

Yuriy Chulovskyy

unread,
Dec 21, 2014, 3:53:30 PM12/21/14
to check...@googlegroups.com
When a team wants to use checkstyle the meet a few issues:
1. IDEA and Eclipse have default/custom formatting settings that causes a lot of checkstyle errors
2. Code analysis tools like SonarCube don't like checkstyle formatting (e.g. even checkstyle project shows a lot of formatting errors in SonarCube http://nemo.sonarqube.org/dashboard/index/com.puppycrawl.tools:checkstyle )

Fixing settings manually is time-consuming.
What we can do?
1. Create maven plugin (or extend IDEA/Eclipse) plugin to generate IDE formatting settings basing on checkstyle settings
2. Create maven plugin to generate checkstyle settings basing on IDE formatting settings

Is it possible?

Roman Ivanov

unread,
Dec 22, 2014, 1:04:31 AM12/22/14
to Yuriy Chulovskyy, check...@googlegroups.com
Hi Yuri,

 IDEA and Eclipse have default/custom formatting settings that causes a lot of checkstyle errors

IDE behavior by default and corporate code standard (style) have nothing in common and will never have. Even code style could be different in team of the same organization/company.
Style is not a law for all ! style is guideline that reconcile some groups of people to write code in the same way. So do not expect that style your team has will be acceptable in another team.

But I agree that it will be good if Checkstyle could at least be able to not conflict with famous IDEs after certain changes in settings in IDE and Checkstyle.

that is not simple but doable task, some talk from the past - https://groups.google.com/forum/#!topic/sevntu-checkstyle/tl7ZKsk-Lss

Code analysis tools like SonarCube don't like checkstyle formatting (e.g. even checkstyle project shows a lot of formatting errors in SonarCu

Checkstyle have never had reports from such tools , so that violations are result of that, we just need to resolve them. One of project for next students summer is "Eat your own food" and enforce Checkstyle to use all his Checks and fail build till violations is found. That will force Checkstyle to fix all violation on his own project after new Check is introduced to prove that it works...... eh dreams .... .

you can generate all reports(findbug, pmd, dsm, .... ) by "mvn -Pdistro package" one day we have to make them show 0 violations..... eh I am dreaming again :)....

Fixing settings manually is time-consuming.
What we can do?
1. Create maven plugin (or extend IDEA/Eclipse) plugin to generate IDE formatting settings basing on checkstyle settings
2. Create maven plugin to generate checkstyle settings basing on IDE formatting settings
Is it possible?

all is possible, it is just takes long time to implement and test. I do not recommend to that by maven plugin only. Smth like that I saw in Eclispe-CS project, but I am not sure.
Such project will be very difficult (due to boring nature) to support, as IDEs are changing constantly. But that project will be extremely useful and popular. I hope some company could fund its support.
I will not have time do participate in it, but could provide some advises and consider changes on Checkstyle side to become friendly with IDEs.


thanks,
Roman Ivanov
Reply all
Reply to author
Forward
0 new messages