Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C7E7200C25 for ; Fri, 24 Feb 2017 10:47:31 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5AE91160B69; Fri, 24 Feb 2017 09:47:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 58BED160B5C for ; Fri, 24 Feb 2017 10:47:30 +0100 (CET) Received: (qmail 37424 invoked by uid 500); 24 Feb 2017 09:47:29 -0000 Mailing-List: contact dev-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list dev@flink.apache.org Received: (qmail 37412 invoked by uid 99); 24 Feb 2017 09:47:29 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 09:47:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 85CAF18E5ED for ; Fri, 24 Feb 2017 09:47:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.993 X-Spam-Level: ** X-Spam-Status: No, score=2.993 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id gvhL6b9ROC-p for ; Fri, 24 Feb 2017 09:47:25 +0000 (UTC) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com [209.85.216.181]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8D4715F647 for ; Fri, 24 Feb 2017 09:47:25 +0000 (UTC) Received: by mail-qt0-f181.google.com with SMTP id r45so12693095qte.3 for ; Fri, 24 Feb 2017 01:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=N5KDFB+P55cYEfNUBlyZAga/Sl+yhn1rMe42pa7AnIA=; b=PI2NFVloAsL+eK71RqjyZDOGjyHoQDnzbPkgoVR3Gn/oq9b7Rj2/p/LEBdZrhtwi+x kB3dpgss2V7AWNBJe6RwFcOrSXgcVmjtaC+HZwFus1DXFJqAWYzW1JpmoaSWD2/eQdc7 QiBuEsQ8nhbjofEQB7lSO/jaP3qlnqBzFASlWEgApKFJeMgNjWqfdCr+1659l4i+v3Wt I4+dVerq3y9De8stPLd78vfZYjq04X2aDfeS9TBOhQlQxyb/8KpCFHtqP/DAnhV8b/iH +OLfcwct1+PQYXyqNZtvvrAb7gK3hE5+Uf2UE1Umu+ymUG1JrcDIwO3S6Wmyr5dESWU8 FK0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=N5KDFB+P55cYEfNUBlyZAga/Sl+yhn1rMe42pa7AnIA=; b=BCxDyDilmA1ItL0z4GHPLf+Vk3hLzRLgGjMxRH0PdJqWsJbT8+ZcuQzAYWyuPNHPA0 wls9stQ+Rw1KzljgXfs4yc89yn6M+9TnQ4GEiftlBXu4i6fMC5vMtnrW0F56DVhzjwOQ 0wH2XNQxfbE0s4sYd6Ho71udGi+TvH0uqO7csCepdn/H6+s+6Bx54x0Rp2vAuq4cGaRD FobCV21NZ/2zXTtLYzp1+zMzL/hWN0fjmTvdZkdo6mWj647EF3Bp7pP0NSAg8/RVY1Qs 2XPB0aVV39tSNLcLm/cV/GP0aqvyRBB0tpv2fw+0UniGNPUb9vY2xFFNcLDDWl18RZRA AR2w== X-Gm-Message-State: AMke39n70icTjw4VHe6d7+YVF8cMzO4qBZzyA14e09tty8BLvp4kGLnIMsszGa3fGRbd55GTwJEU5C3bKCH5kw== X-Received: by 10.200.53.145 with SMTP id k17mr1555645qtb.47.1487929645035; Fri, 24 Feb 2017 01:47:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.34.213 with HTTP; Fri, 24 Feb 2017 01:46:54 -0800 (PST) In-Reply-To: References: <58AD70DF.7010001@apache.org> <58ADB7A7.7010308@apache.org> From: Fabian Hueske Date: Fri, 24 Feb 2017 10:46:54 +0100 Message-ID: Subject: Re: [DISCUSS] Code style / checkstyle To: "dev@flink.apache.org" Content-Type: multipart/alternative; boundary=001a11409ca8f176260549439d44 archived-at: Fri, 24 Feb 2017 09:47:31 -0000 --001a11409ca8f176260549439d44 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable We have discussed this issue several times in the past and never got around to do it. Although I agree that it would be nice to have a stricter code style, I don't think we should introduce a code style. IMO, at this point the costs (losing the history, PR hassle, etc.) would be too high compared to the benefits (that I am aware of). I agree with Till that encouraging a code style without enforcing it does not make a lot of sense. If we enforce it, we need to touch all files and PRs. On the other hand, it's not clear to me how much we would gain with a code style and what's the cost of not having one. Best, Fabian 2017-02-23 17:52 GMT+01:00 Jinkui Shi : > Thanks to discuss this problem again. > 1. Google checkstyle is good for java. > 2. scala check style is here [1] > 3. We can make a Flink plan contain issues, one sub-issue one rule. > Resolve this in short time. > > Current code style may be historical accumulate. If we don=E2=80=99t norm= alize the > code step by step, new code will also follow bad style without strict > checking. > We can adjust the exist code once one rule. But there will be lots of > conflict in the not merged pull requests. Need all the pull request resol= ve > the conflict manually. > Resolve long term trouble in short time:) > > > [1] http://www.scalastyle.org/ > > On Feb 23, 2017, at 23:31, Aljoscha Krettek wrote= : > > > > If we go for a codestyle/checkstyle I would suggest to use the Google > > style. This already has checkstyle, IntelliJ style, Eclipse style and a > > code formatting tool and is well established. However, some people will > not > > like this style. In general, I think we will never manage to find a sty= le > > that all people will like. > > > > On Wed, 22 Feb 2017 at 18:36 Dawid Wysakowicz < > wysakowicz.dawid@gmail.com> > > wrote: > > > >> So how about preparing a code style and corresponding checkstyle and > >> enabling it gradually module by module whenever shepherd/commiter with > >> expertise in a module will have time to introduce/check such a change? > >> Maybe it will make the "snowball effect" happen? > >> I agree there is no point in preparing code style/checkstyle until it > will > >> be introduced somewhere. I will be willing to work on the checkstyle i= f > >> some volunteering modules appear. > >> > >> 2017-02-22 17:09 GMT+01:00 Chesnay Schepler : > >> > >>> For file where we don't enforce checkstyle things should work they wa= y > >>> they do right now. > >>> > >>> Turn off auto-formatting, and only format code that you touched and > >> that's > >>> it. For these > >>> modification we will have to check them manually in the PRs as we do > now. > >>> > >>> > >>> On 22.02.2017 16:22, Greg Hogan wrote: > >>> > >>>> Will not the code style be applied on save to any user-modified file= ? > So > >>>> this will clutter PRs and overwrite history. > >>>> > >>>> On Wed, Feb 22, 2017 at 6:19 AM, Dawid Wysakowicz < > >>>> wysakowicz.dawid@gmail.com> wrote: > >>>> > >>>> I also agree with Till and Chesnayl. Anyway as to "capture the curre= nt > >>>>> style" I have some doubts if this is possible, as it changes file t= o > >>>>> file. > >>>>> > >>>>> Chesnay's suggestion as to were enforce the checkstyle seems > reasonable > >>>>> to > >>>>> me, but I am quite new to the community :). > >>>>> Enabling checkstyle for particular packages is possible. > >>>>> > >>>>> 2017-02-22 12:07 GMT+01:00 Chesnay Schepler : > >>>>> > >>>>> I agree with Till. > >>>>>> > >>>>>> I would propose enforcing checkstyle on a subset of the modules, > >>>>>> > >>>>> basically > >>>>> > >>>>>> those that are not > >>>>>> flink-runtime, flink-java, flink-streaming-java. These are the one= s > >> imo > >>>>>> where messing with the history > >>>>>> can be detrimental; for the others it isn't really important imo. > >>>>>> (Note that i excluded scala code since i don't know the state of > >>>>>> checkstyle compliance there) > >>>>>> > >>>>>> For flink-runtime we could maybe (don't know if it is supported) > >> enforce > >>>>>> checkstyle for all classes > >>>>>> under o.a.f.migration, so that at least the flip-6 code is covered= . > >>>>>> > >>>>>> Similarly, enforcing checkstyle for all tests should be fine as > well. > >>>>>> > >>>>>> Regards, > >>>>>> Chesnay > >>>>>> > >>>>>> > >>>>>> On 22.02.2017 11:48, Till Rohrmann wrote: > >>>>>> > >>>>>> I think that not enforcing a code style is as good as not having a= ny > >>>>>>> > >>>>>> code > >>>>> > >>>>>> style to be honest. Having an IntelliJ or Eclipse profile is nice > and > >>>>>>> > >>>>>> some > >>>>> > >>>>>> people will probably use it, but my gut feeling is that the majori= ty > >>>>>>> > >>>>>> won't > >>>>> > >>>>>> notice it. > >>>>>>> > >>>>>>> Cheers, > >>>>>>> Till > >>>>>>> > >>>>>>> On Wed, Feb 22, 2017 at 11:15 AM, Ufuk Celebi > >> wrote: > >>>>>>> > >>>>>>> Kurt's proposal sounds reasonable. > >>>>>>> > >>>>>>>> What about the following: > >>>>>>>> - We try to capture the current style in an code style > configuration > >>>>>>>> (for IntelliJ and maybe Eclipse) > >>>>>>>> - We provide that on the website for contributors to download > >>>>>>>> - We don't enforce it, but new contributions and changes are fre= e > to > >>>>>>>> format with this style as changes happen > >>>>>>>> > >>>>>>>> Practically speaking, this should not change much except maybe t= he > >>>>>>>> import order or whitespace after certain keywords, etc. > >>>>>>>> > >>>>>>>> > >>>>>>>> On Wed, Feb 22, 2017 at 4:48 AM, Kurt Young > >> wrote: > >>>>>>>> > >>>>>>>> +1 to provide a unified code style for both java and scala. > >>>>>>>>> > >>>>>>>>> -1 to adjust all the existing code to the new style in one step= . > >> The > >>>>>>>>> > >>>>>>>>> code's > >>>>>>>> > >>>>>>>> history contains very helpful information which can help > >>>>>>>>> develops to understand why these codes are added, which jira is > >>>>>>>>> > >>>>>>>> related. > >>>>> > >>>>>> This information is too valuable to lose. I think we can > >>>>>>>>> do the reformat thing step by step, each time when the codes > being > >>>>>>>>> > >>>>>>>>> changed, > >>>>>>>> > >>>>>>>> we can adopt them to the new style. > >>>>>>>>> IMHO this is also the reason why the unified code style is > >> important. > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> Best, > >>>>>>>>> Kurt > >>>>>>>>> > >>>>>>>>> On Wed, Feb 22, 2017 at 5:50 AM, Dawid Wysakowicz < > >>>>>>>>> wysakowicz.dawid@gmail.com> wrote: > >>>>>>>>> > >>>>>>>>> Hi, > >>>>>>>>> > >>>>>>>>>> I would like to resurrect the discussing ([1] > >>>>>>>>>> >>>>>>>>>> nabble.com/Code-style-guideline-for-Scala-td7526.html> > >>>>>>>>>> , [2] > >>>>>>>>>> >>>>>>>>>> nabble.com/Intellij-code-style-td11092.html>) > >>>>>>>>>> about creating unified code style(that could be imported to at > >> least > >>>>>>>>>> IntelliJ and Eclipse) and corresponding stricter checkstyle > rules. > >>>>>>>>>> > >>>>>>>>>> I know that the hardest part is to adjust the existing code to > the > >>>>>>>>>> > >>>>>>>>> new > >>>>> > >>>>>> checkstyle rules. Do you believe it would be worth the effort? All > >>>>>>>>>> suggestions are welcome. > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>> > >> > > --001a11409ca8f176260549439d44--