Difference between revisions of "Checkstyle Eclipse"
(→Eclipse) |
(→Use the plugin) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Checkstyle== | ==Checkstyle== | ||
− | The rulesets try to implement the [[ | + | The rulesets try to implement the [[Coding guidelines]]. If changes occur please carry them over to the checkstyle file.<br/> |
+ | [http://checkstyle.sourceforge.net/ Checkstyle documentation] | ||
==Eclipse== | ==Eclipse== | ||
Line 6: | Line 7: | ||
===Get the plugin=== | ===Get the plugin=== | ||
+ | First go to the marketplace to fetch the plugin.<br/> | ||
[[File:Eclipse plugin step 1.PNG]] | [[File:Eclipse plugin step 1.PNG]] | ||
− | [[File:Eclipse plugin step 2.PNG]] | + | [[File:Eclipse plugin step 2.PNG]]<br/> |
− | [[File:Eclipse plugin step 3.PNG]] | + | After installation a restart will be needed to enable the plugin correctly. Once eclipse is running again, in the preferences a new register will be shown for the checkstyle configuration. To get there open up the preferences, either for a specific project or for eclipse in total.<br\> |
− | [[File:Eclipse plugin step 4.PNG]] | + | [[File:Eclipse plugin step 3.PNG]]<br/> |
+ | Now specify a new rule set with a link to the checkstyle.xml file.<br/> | ||
+ | [[File:Eclipse plugin step 4.PNG]]<br/> | ||
+ | Save your configuration and ensure it is set to be active in the project you wish to use it as checkstyle files may be different for specific projects. | ||
===Use the plugin=== | ===Use the plugin=== | ||
+ | To use the configured plugin it may be accessed via the context menu. If the context menu is brought up on a project node it is possible to configure the Eclipse-Auto-Format with the checkstyle settings. It is recommended to use this option after each update on the checkstyle file to ensure the autoformat and import orders follow the checkstyle rulesets.<br\> | ||
+ | [[File:Eclipse plugin use 1.PNG]]<br/> | ||
+ | or/and it can be added as view<br/> | ||
+ | [[File:Eclipse plugin use 2.PNG]]<br/> | ||
+ | This plugin also provides inline highlighting.<br/> | ||
+ | [[File:Eclipse plugin use 3.PNG]] |
Latest revision as of 15:55, 17 February 2013
Checkstyle
The rulesets try to implement the Coding guidelines. If changes occur please carry them over to the checkstyle file.
Checkstyle documentation
Eclipse
To integrate the checkstyle file well with Eclipse I would recommend the Checkstyle Plugin that can be found in the marketplace.
Get the plugin
First go to the marketplace to fetch the plugin.
After installation a restart will be needed to enable the plugin correctly. Once eclipse is running again, in the preferences a new register will be shown for the checkstyle configuration. To get there open up the preferences, either for a specific project or for eclipse in total.<br\>
Now specify a new rule set with a link to the checkstyle.xml file.
Save your configuration and ensure it is set to be active in the project you wish to use it as checkstyle files may be different for specific projects.
Use the plugin
To use the configured plugin it may be accessed via the context menu. If the context menu is brought up on a project node it is possible to configure the Eclipse-Auto-Format with the checkstyle settings. It is recommended to use this option after each update on the checkstyle file to ensure the autoformat and import orders follow the checkstyle rulesets.<br\>
or/and it can be added as view
This plugin also provides inline highlighting.