I know that there are similar questions in Stackoverflow, but they were either .Net related, or did not receive any answer that helped us.
The point is: with some friends we are starting an open source project. Having established the foundations of a successful project, the question arose: how to ensure compliance with the code symbols of the project?
We believe that as an open source project, if people start to reformat the code as they see fit, patches will clutter up the changes due to formatting that will hide the real "value" of the patch. Therefore, we want something that forces users to adhere to specific formatting, disrupting the assembly if they do not.
The project uses Struts 2 + Spring + Hibernate using Maven 2 (thinking about switching to Maven 3). We know that we can use "CheckStyle" to check Java files, but this leaves some questions open, which I hope someone can answer:
- Is there a way to check the style of XML and SQL files by breaking the assembly if they don't follow the rules?
- Is there any tool that automatically reformats the source files (Java, XML, SQL) to the required convention? Could it be integrated with Maven in some way?
We could find Jalopy for Java files, but we would prefer a free tool (as far as we know, the latest version is paid). And we still haven't found anything for SQL / XML.
UPDATE:, : PMD, Checkstyle . , :
- SQL, XML / Java (4 ..)
- SQL XML - .