You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streams.apache.org by Joey Frazee <jo...@icloud.com> on 2016/10/27 22:46:42 UTC

[DISCUSS] Coding style conventions + auto-formatting

With some new contributors and project members joining, a question came up around coding conventions. Having something official is probably a necessary evil. Here are a few options:

- https://google.github.io/styleguide/javaguide.html

- https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/styleguide.md

- https://opennlp.apache.org/code-conventions.html

I'm sure there are more. Thoughts?

Whatever happens, I'd suggest it just get enforced via Maven so we don't have to kick PRs back and forth or keep discussing it. To that effect I opened https://issues.apache.org/jira/browse/STREAMS-449

-joey


Re: [DISCUSS] Coding style conventions + auto-formatting

Posted by sblackmon <sb...@apache.org>.
I’ve set up checkstyle and scalastyle (bound to validate phase, no fail on error) over in 

https://github.com/steveblackmon/incubator-streams-master/tree/STREAMS-439
https://github.com/steveblackmon/incubator-streams/tree/STREAMS-439

and started refactoring code to match the google style in

https://github.com/steveblackmon/incubator-streams/tree/STREAMS-440

The google_style.xml that ships with the plugin needs a few tweaks:

- we need org.apache.streams.* to be at the top of the import list, not com.google.*
- 100 characters per line isn’t enough.  I think we can make 140 work. 

So I still need to figure out where / how to publish a modified check style file so that works transparently across all three repos.

If anyone has specific ideas about how to systematically modify existing code to match the style guide, please let me know over in 
https://issues.apache.org/jira/browse/STREAMS-449

Steve
On November 2, 2016 at 6:11:51 AM, Praveen Adlakha (praveen.adlakha@inmobi.com) wrote:

Hi All,  

+1 for maven checkstyle plugin it's a widely accepted solution to the  
problem at hand.  

Minor nit: We can think in terms of creating a different profile to run  
checkstyle plugin it kind of ease the development when a developer is  
working on enhancements which require a lot of code.  

Thanks  
Praveen  

On Sat, Oct 29, 2016 at 12:28 AM, Timothy Spann <ts...@hortonworks.com>  
wrote:  

> >  
>  
> +1 for Google. Easy to import into any IDE and enforced with  
> checkstyle.  
>  
>  
> >  
> > -  
> > https://github.com/twitter/commons/blob/master/src/java/  
> com/twitter/common/styleguide.md  
> >  
> > - https://opennlp.apache.org/code-conventions.html  
> >  
> > I'm sure there are more. Thoughts?  
> >  
> > Whatever happens, I'd suggest it just get enforced via Maven so we  
> don't  
> > have to kick PRs back and forth or keep discussing it. To that  
> effect I  
> > opened https://issues.apache.org/jira/browse/STREAMS-449  
>  
> https://maven.apache.org/plugins-archives/maven-checkstyle-plugin-2.16/  
>  
> And can check that from IDEs as well.  
>  
> Tim Spann  
>  
>  

--  
_____________________________________________________________  
The information contained in this communication is intended solely for the  
use of the individual or entity to whom it is addressed and others  
authorized to receive it. It may contain confidential or legally privileged  
information. If you are not the intended recipient you are hereby notified  
that any disclosure, copying, distribution or taking any action in reliance  
on the contents of this information is strictly prohibited and may be  
unlawful. If you have received this communication in error, please notify  
us immediately by responding to this email and then delete it from your  
system. The firm is neither liable for the proper and complete transmission  
of the information contained in this communication nor for any delay in its  
receipt.  

Re: [DISCUSS] Coding style conventions + auto-formatting

Posted by Praveen Adlakha <pr...@inmobi.com>.
Hi All,

+1 for maven checkstyle plugin it's a  widely accepted solution to the
problem at hand.

Minor nit: We can think in terms of creating a different profile to run
checkstyle plugin it kind of ease the development when a developer is
working on enhancements which require a lot of code.

Thanks
Praveen

On Sat, Oct 29, 2016 at 12:28 AM, Timothy Spann <ts...@hortonworks.com>
wrote:

> >
>
>     +1 for Google.  Easy to import into any IDE and enforced with
> checkstyle.
>
>
>     >
>     > -
>     > https://github.com/twitter/commons/blob/master/src/java/
> com/twitter/common/styleguide.md
>     >
>     > - https://opennlp.apache.org/code-conventions.html
>     >
>     > I'm sure there are more. Thoughts?
>     >
>     > Whatever happens, I'd suggest it just get enforced via Maven so we
> don't
>     > have to kick PRs back and forth or keep discussing it. To that
> effect I
>     > opened https://issues.apache.org/jira/browse/STREAMS-449
>
> https://maven.apache.org/plugins-archives/maven-checkstyle-plugin-2.16/
>
> And can check that from IDEs as well.
>
> Tim Spann
>
>

-- 
_____________________________________________________________
The information contained in this communication is intended solely for the 
use of the individual or entity to whom it is addressed and others 
authorized to receive it. It may contain confidential or legally privileged 
information. If you are not the intended recipient you are hereby notified 
that any disclosure, copying, distribution or taking any action in reliance 
on the contents of this information is strictly prohibited and may be 
unlawful. If you have received this communication in error, please notify 
us immediately by responding to this email and then delete it from your 
system. The firm is neither liable for the proper and complete transmission 
of the information contained in this communication nor for any delay in its 
receipt.

Re: [DISCUSS] Coding style conventions + auto-formatting

Posted by Timothy Spann <ts...@hortonworks.com>.
>
    
    +1 for Google.  Easy to import into any IDE and enforced with checkstyle.
    
    
    >
    > -
    > https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/styleguide.md
    >
    > - https://opennlp.apache.org/code-conventions.html
    >
    > I'm sure there are more. Thoughts?
    >
    > Whatever happens, I'd suggest it just get enforced via Maven so we don't
    > have to kick PRs back and forth or keep discussing it. To that effect I
    > opened https://issues.apache.org/jira/browse/STREAMS-449

https://maven.apache.org/plugins-archives/maven-checkstyle-plugin-2.16/

And can check that from IDEs as well.

Tim Spann 


Re: [DISCUSS] Coding style conventions + auto-formatting

Posted by Matt Franklin <m....@gmail.com>.
On Thu, Oct 27, 2016 at 6:46 PM Joey Frazee <jo...@icloud.com> wrote:

> With some new contributors and project members joining, a question came up
> around coding conventions. Having something official is probably a
> necessary evil. Here are a few options:
>
> - https://google.github.io/styleguide/javaguide.html
>

+1 for Google.  Easy to import into any IDE and enforced with checkstyle.


>
> -
> https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/styleguide.md
>
> - https://opennlp.apache.org/code-conventions.html
>
> I'm sure there are more. Thoughts?
>
> Whatever happens, I'd suggest it just get enforced via Maven so we don't
> have to kick PRs back and forth or keep discussing it. To that effect I
> opened https://issues.apache.org/jira/browse/STREAMS-449
>
> -joey
>
>
>