Hi Stas,
Thanks for sharing !
As discussed with Amit on Hangout (and indirectly with you ;)), it's
what I'm using in my config.
Some stuff that I added on IntelliJ:
- in Editor -> Code Style -> Java -> Tabs and Indents, I disabled "Use
tab character", and defined 2 for "Tab Size" and "Indent", and 4 for
"Continuation indent".
- in Editor -> Code Style -> Java -> Imports, I changed the layout to
match the checkstyle definition (static first, <blank line>,
org.apache.beam.*, <blank line>, com.google.*, ...)
- in Editor -> Code Style -> Java -> Wrapping and Braces, I enabled
"Ensure right margin is not exceeded"
I also enabled checkstyle in code inspection, and the checkstyle button
(next to the terminal button in the button bar).
Related to the discussion about checkstyle, I think it makes sense to
add a section about "Configuring IDE" in the contribution guide.
WDYT ?
Regards
JB
On 08/24/2016 04:35 PM, Stas Levin wrote:
Hi guys,
Having IntelliJ enforce Beam's Checkstyle rules turned out to be very
useful for me, so I figured I'd share the steps just in case.
1. Install the Checkstyle plugin
1. Select the *Plugins* menu from the *Preferences* (Cmd+",")
2. Click "*Browse Repositories*"
3. Type "*Checkstyle-IDEA*" in the search box and select the search
result
4. Click "*install*"
5. *Restart* Intellij
2. Activate Beam's checkstyle rules
1. Select the newly added "*Checkstyle*" menu from the Preferences
(Cmd+",") menu
2. Hit the "*+*" icon to add a checkstyle file, *select Beam's
checkstyle.xm*l
"..incubator-beam/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml"
3. Check the "*Active*" checkbox to activate
3. Done!
Hope you find this useful.
Regards,
Stas
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com