From dev-return-49864-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Wed May 19 22:26:31 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id B88F218063D for ; Thu, 20 May 2021 00:26:31 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id E6AF43F179 for ; Wed, 19 May 2021 22:26:30 +0000 (UTC) Received: (qmail 17290 invoked by uid 500); 19 May 2021 22:26:30 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 17278 invoked by uid 99); 19 May 2021 22:26:29 -0000 Received: from spamproc1-he-fi.apache.org (HELO spamproc1-he-fi.apache.org) (95.217.134.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 May 2021 22:26:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-fi.apache.org (ASF Mail Server at spamproc1-he-fi.apache.org) with ESMTP id 3C8B4C0440 for ; Wed, 19 May 2021 22:26:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-fi.apache.org X-Spam-Flag: NO X-Spam-Score: -0.201 X-Spam-Level: X-Spam-Status: No, score=-0.201 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamproc1-he-fi.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-fi.apache.org [95.217.134.168]) (amavisd-new, port 10024) with ESMTP id foXB3ONstruv for ; Wed, 19 May 2021 22:26:28 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::e33; helo=mail-vs1-xe33.google.com; envelope-from=vatamane@gmail.com; receiver= Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 956207FE85 for ; Wed, 19 May 2021 22:26:28 +0000 (UTC) Received: by mail-vs1-xe33.google.com with SMTP id j13so7554455vsf.2 for ; Wed, 19 May 2021 15:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=swIzMBEDUNKVhHEvHuwaC5w2li3kWjgxuK2jgPsO9ac=; b=k158ZvI27t02dxWKgR9MXkVnEXbfNi0pmlEz5DbY6eqzJQJHy49Mizk1he0RWk68h1 QbZrMjOmD8fNieWjZa6YjMvJUnkJbIv5M4Aq9a+YtmuNKB6nTe/0X9nRBxrVRjb7Gxl7 o8QLHYuMiO+gQMKMyWmed/UgQVS3Pp13E+pBxlZwHDEqUuVlFdEw+tMcLRYZBgledz9o dcHi9M+cTNvJMYtKpSuAefLqB3IboSL4F4g+ymj8WIhwEdoQPBvEYjuz+FVDG+j+ykcS bbZqNUH5brTHIFi3z4bUKt7llsR/iQUm8W5XLChwaEmUBovnJQeAe4lEqy0EbhVMpS/Z vIiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=swIzMBEDUNKVhHEvHuwaC5w2li3kWjgxuK2jgPsO9ac=; b=FZVuENkDPZo2NNMbvbPprtLAxzgit8q6+0J3gBu8oxbCOu3Ly0JWTVrdk8xc6wvNja zdUbr9YRVs8T1N920M8M5KptM+YrQp/oKxfWnSIu2iqq+ZUVT2q5jX13EBIrSmJFq4Kg pZyQkibFGUVyxO0Xw0Y13QieEf7WJd50+oI5MvKfBTL4uFKPvKGE6UEhxMKIbvyQzUPs PjstDu/JPTEwAlIJBOscLGB1l+k6fQtvwNqk+1YB3VWefyNQ4SfarDEXcv48JkEgCON4 q/jfAtQBBdkd0JHnkGVqCoEDobzFmYssgNNsGzMNY2Op5PMsWGiXwxCjWDzlafVjUnr5 JJWQ== X-Gm-Message-State: AOAM533RwlDG01BxE95CX1jOWI6W8R9b38tY2RYjF8bn88E+kuIkIzJ8 t1HwgcZWIHwJea3JSU+lKo9ulCWPJ5yrTrJXBfRVdcqJZBP3+A== X-Google-Smtp-Source: ABdhPJzHgWgcXyY1kbaTohWov9I/J2TwmY7hy5i9e344R85UiHtbKpQktG37MvIz0ID0LdJhCNOKlFRw/ItwpLPYfpA= X-Received: by 2002:a67:1984:: with SMTP id 126mr1518496vsz.46.1621463186884; Wed, 19 May 2021 15:26:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nick Vatamaniuc Date: Wed, 19 May 2021 18:26:15 -0400 Message-ID: Subject: Re: Reformat src files with `erlfmt` on `main` To: dev@couchdb.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Good idea, Don=C3=A1t! Thanks for giving it a try. Even though I personally think emilio has a better style, and I don't agree with some of the choices erlfmt makes, I still think it would still be a net benefit to having consistency if we get automated code reformatting. So +1 overall. If there are modules or areas we really don't want reformatted, erlfmt allows comment pragmas (%% erlfmt-ignore [1]) to disable re-formatting for some sections of code. There are also some suggestions to do minor manual refactorings which result in a better formatted code [2] , so we could apply a few of those in some places. A few more ideas and comments I had were in the PR comment https://github.com/apache/couchdb/pull/3568#issuecomment-842569320 [1] https://github.com/WhatsApp/erlfmt#ignoring-formatting [2] https://github.com/WhatsApp/erlfmt#manual-interventions Cheers, -Nick On Tue, May 18, 2021 at 2:13 PM Bessenyei Bal=C3=A1zs Don=C3=A1t wrote: > > Hi dev@couchdb, > > To eliminate the need for formatting-related comments and thus > unnecessary cycles in PRs, I've invested a little time to see if we > could use a formatter on `main` [1]. > The PR reformats `.erl` files in `src` and the script [2] included > shows that the compiled binaries match "before" and "after". > The formatter used in the PR is `erlfmt` [3] which is an opinionated > [4] tool so it's more of a "take it or leave it" as-is. (We could try > using other formatters if we want in case people want formatting but > think the choices `erlfmt` makes are unacceptable.) > Some members of the CouchDB dev community already left some great > comments on the PR and I haven't seen any strong opposition so far, > but I wanted to make sure more people are aware of this. > If you have any questions, comments or concerns (or objections), > please let me know. > > > Thank you, > > Donat > > > [1]: https://github.com/apache/couchdb/pull/3568 > [2]: https://github.com/apache/couchdb/pull/3568/files#diff-7adfbc2d8dba4= d4ff49ff2b760b81c006097f20f412ea2007f899042fd0de98a > [3]: https://github.com/WhatsApp/erlfmt > [4]: https://github.com/WhatsApp/erlfmt#comparison-with-other-erlang-form= atters