Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Use the Eclipse Checkstyle plugin: http://eclipse-cs.sourceforge.net/
    • Note that you can drag the plugin into your Eclipse installation
  • Right click your DSpace project; select Properties → Checkstyle
  • Go to "Checkstyle → Local check configurations" and click "New"
    • Create a "Project Relative Configuration"
    • Name: DSpace Internal
    • Location: checkstyle.xml
  • An "Unresolved Properties Error" box will appear; click "Edit Properties"
    • Add a new property
      • Name: checkstyle.suppressions.file
      • Value: checkstyle-suppressions.xml
    • Click OK
  • Go to "Checkstyle → Main"
    • Select "DSpace Internal" from the drop down
    • Check "Checkstyle active for this project"
    • Click OK
  • Code will be rebuilt
  • Edit a java file.  Place a curly brace on a line by itself.
    • The line of code should get highlighted in red.
    Import our checkstyle.xml

Tested and works to validate code. To format you must generate a formatter style following the steps here. It seems impossible to force eclipse to use braces on sinle-line if statement

...