Hi all,
I have been trying to figure out how to work with checkstyle for some time now and I cannot seem to get a simple custom check project working.
Here's what I have accomplished:
- Edited the google_checks.xml file in the plug-in so that line limit is 80 instead of 100.
- Editedgoogle_checks.xml file in the plug-in so that the indentations are by 4 not by 2.
- I ran mvn clean package -Passembly, then with the jar made I ran java -jar [jar-file created] -c google_checks.xml [my java file]
All I really want to do now is:
- Use the previous checks for a specific java file.
- Have a custom checks project that also includes a method limit check (like the one on the Checkstyle website) and an "over-looping" check (probably using the NestedForDepth module).
- Have those google_checks AND my custom checks in one project so that I can use them in command line to check specific Java files.
I have been using the maven instruction on this (as seen in
https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/custom-developed-checkstyle.html) as I don't find the explanation inthe checkstyle website to be very straight forward.
I'm genuinely so lost, I just want to help my professor automate some of his grading. If there are any simple instruction videos some of you know of, please do share.
- Gabriel