Mobile/Fennec/Android/Static analysis/checkstyle-idea: Difference between revisions
< Mobile | Fennec | Android | Static analysis
Jump to navigation
Jump to search
| Line 13: | Line 13: | ||
=== Adding the config file === | === Adding the config file === | ||
* Open the preferences | * Open the preferences | ||
* Go to (or search for) "Checkstyle" menu item (it's under "Other Settings") | * Go to (or search for) "Checkstyle" menu item (it's under "Other Settings") | ||
Revision as of 10:53, 12 April 2016
You can run checkstyle via the checkstyle-idea plugin within Android Studio or Intellij. It will highlight violations in red, e.g. package statements should not span more than one line:
Installation
- Open the preferences
- Find "Plugins" in the preferences
- Click "Browse repositories"
- Search for "checkstyle".
- Select CheckStyle-IDEA
- Click "Install plugin" on the right & confirm
- Click restart Android Studio
Adding the config file
- Open the preferences
- Go to (or search for) "Checkstyle" menu item (it's under "Other Settings")
- Click the plus at the bottom of the "Configuration file" box
- Add a description (e.g. "mozilla")
- Add the path to the checkstyle configuration:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/checkstyle.xml
- Accept
- Click the "Active" checkbox next to the new configuration
- Hit "OK" to close the preferences
