We'd like to find a "lightweight" method of enforcing code standards prior to check-in. We really like the idea of using Eclipse's built-in Save Actions (go to Preferences >> Java >> Editor >> Save Actions
) which has a Format source code
function that can run every time the developer saves a file.
This way, so long as each developer using the same format rules, and has Save Actions enabled, we can be fairly comfortable that by the time code makes it to review, that our code standards have been enforced (for the most part).
What I'm trying to figure out is: what file(s) does Eclipse use to save these format rules to? How could I keep such a file in source control, and have developers check it out?
The workspace-wide save action configuration is stored in your workspace directory in this file:
WORKSPACE-DIR\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.jdt.ui.prefs
Adding this file to source control would be somewhat tricky, as it is workspace-specific and not project-specific. You can however, enable project-specific save action configuration via the save action wizard. In that case, the configuration is stored in your project path, under:
PROJECT-DIR\.settings\org.eclipse.jdt.ui.prefs
This file can easily be put under source code control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With