You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Stas Levin <st...@gmail.com> on 2016/08/24 14:35:52 UTC

Configuring IntelliJ to enforce checkstyle rules

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

Re: Configuring IntelliJ to enforce checkstyle rules

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Good idea.

Regards
JB

On 08/25/2016 05:51 PM, Seetharam Venkatesh wrote:
> You can also export idea settings and interested developers can import it
> instead.
>
> Adding check style slows down idea significantly in my experience but ymmv.
>
> On Wed, Aug 24, 2016 at 8:29 AM Kenneth Knowles <kl...@google.com.invalid>
> wrote:
>
>> Nice step-by-step.
>>
>> +1 to adding tips for particular IDEs in the contribution guide.
>>
>> On Wed, Aug 24, 2016 at 7:48 AM, Jean-Baptiste Onofr� <jb...@nanthrax.net>
>> wrote:
>>
>>> 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�
>>> jbonofre@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>>>
>>
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Configuring IntelliJ to enforce checkstyle rules

Posted by Seetharam Venkatesh <ve...@innerzeal.com>.
You can also export idea settings and interested developers can import it
instead.

Adding check style slows down idea significantly in my experience but ymmv.

On Wed, Aug 24, 2016 at 8:29 AM Kenneth Knowles <kl...@google.com.invalid>
wrote:

> Nice step-by-step.
>
> +1 to adding tips for particular IDEs in the contribution guide.
>
> On Wed, Aug 24, 2016 at 7:48 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
> > 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é
> > jbonofre@apache.org
> > http://blog.nanthrax.net
> > Talend - http://www.talend.com
> >
>

Re: Configuring IntelliJ to enforce checkstyle rules

Posted by Kenneth Knowles <kl...@google.com.INVALID>.
Nice step-by-step.

+1 to adding tips for particular IDEs in the contribution guide.

On Wed, Aug 24, 2016 at 7:48 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> 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é
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Configuring IntelliJ to enforce checkstyle rules

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com