Page History
...
- A Maven plugin for checkstyle verification exists (which can validate styles on build): maven-checkstyle-plugin
- Existing Checkstyle configurations
- The Fedora project has its own Checkstyle configuration (for its style guide): https://github.com/fcrepo4/fcrepo-build-tools/blob/master/src/main/resources/fcrepo-checkstyle/checkstyle.xml
- A Google Checkstyle configuration is at: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
- A Sun Checkstyle configuration is at: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml
- Early notes on enabling Checkstyle in DSpace codebase are available in this gist: https://gist.github.com/tdonohue/b51b919b87b5f08930fac4fd9d52b9ae
- Note: Currently, it borrows heavily from the Fedora Checkstyle configuration (just as an example). We'd need to update the actual checkstyle.xml based on our final style guide.
Branches to enable Checkstyle on?
Which git branches would we want to enable Checkstyle on?
- Initially, likely just the
master
branch, and perhaps just specific modules (e.g. "dspace-spring-rest") on themaster
branch.- Enabling on
master
branch only may complicate cherry-picking of code changes from other branches (as line numbers, spacing, etc may change when the code is updated to use the latest DSpace Style Guide) - However, if we implement this module-by-module (starting with "dspace-spring-rest", the new DSpace 7 REST API), this may temporarily minimize the cherry-pick conflicts while also ensuring any new code meets the new style guidelines.
- Enabling on
- Backporting to other branches (dspace-6_x, dspace-5_x, dspace-4_x) is yet to be determined.
- Backporting might affect local checkouts/forks of these branches, as a large number of files will change at once. This has the potential to cause local merge conflicts to occur.
IDE Support
Most major IDEs include plugins that support Checkstyle configurations. The plugin usually let you import an existing "checkstyle.xml" configuration to configure your IDE to use and/or validate against that style. (Please note: we have not tested all these plugins as of yet, so mileage may vary until we test/verify the plugin is usable)
...
Overview
Content Tools