[Openvpn-devel,2/2] uncrustify: remove newlines after return type of function prototype
| Message ID | 20220818201505.656149-2-frank@lichtenheld.com |
|---|---|
| State | Rejected |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id sHMzHDGe/mLXFwAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Thu, 18 Aug 2022 16:16:49 -0400 Received: from proxy17.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id 4AayGzGe/mLCQAAAovjBpQ (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Thu, 18 Aug 2022 16:16:49 -0400 Received: from smtp23.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.ord1d.rsapps.net with LMTPS id oACZGzGe/mLPZAAAWC7mWg (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Thu, 18 Aug 2022 16:16:49 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp23.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=lichtenheld.com X-Suspicious-Flag: YES X-Classification-ID: b032b4a0-1f32-11ed-8860-525400bfb165-1-1 Received: from [216.105.38.7] ([216.105.38.7:48530] helo=lists.sourceforge.net) by smtp23.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 19/91-04302-03E9EF26; Thu, 18 Aug 2022 16:16:48 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1oOlvG-0001Ey-2Y; Thu, 18 Aug 2022 20:15:22 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <frank@lichtenheld.com>) id 1oOlvE-0001Eo-5b for openvpn-devel@lists.sourceforge.net; Thu, 18 Aug 2022 20:15:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NEdP65i7w2NILqyhdSSgvnN5wVhlM8C6xUpmzl1KiIk=; b=jOzNx3BDSiDZbfzri77ECET+BE Y+n2GZu2lrn4aNwMm2sCK4WDXI/jwO0xVqP7GjAhnJ08Qc4dMZxm4AJ75HGM46c+5y9unddEQ+1ah Z3j1dvUSmuMSkuIgx8TkD4Yslk0u9UkWKbkVvZW5AEHS8vo/JJaX1a41R/pJPUS9ehO4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NEdP65i7w2NILqyhdSSgvnN5wVhlM8C6xUpmzl1KiIk=; b=BS8LLD5EQDt6yX3LlGNTlPGunJ bSOqlvd7H7AmZNwFlV6InX0vc2F2G8YZxQEMewbVGaFna4x5RAupiFONTZiF0pl731/yroyvpRVur 7AAlXzovFBYzCdYSGiiD1C/GOpnAe1qHAaEa/uIrLNmJp7AB4ugIF65LIEN+uG3ieceA=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oOlvD-008KQi-64 for openvpn-devel@lists.sourceforge.net; Thu, 18 Aug 2022 20:15:20 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4M7x2M5WtXz9sQH for <openvpn-devel@lists.sourceforge.net>; Thu, 18 Aug 2022 22:15:07 +0200 (CEST) From: Frank Lichtenheld <frank@lichtenheld.com> To: openvpn-devel@lists.sourceforge.net Date: Thu, 18 Aug 2022 22:15:05 +0200 Message-Id: <20220818201505.656149-2-frank@lichtenheld.com> In-Reply-To: <20220818201505.656149-1-frank@lichtenheld.com> References: <20220818201505.656149-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4M7x2M5WtXz9sQH X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> --- dev-tools/uncrustify.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/dev-tools/uncrustify.conf b/dev-tools/uncrustify.conf index 325f3108..c73fba0c 100644 --- a/dev-tools/uncrustify.conf +++ b/dev-tools/uncrustify.conf @@ -40,6 +40,7 @@ sp_after_comma=add [...] Content analysis details: (-0.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1oOlvD-008KQi-64 Subject: [Openvpn-devel] [PATCH 2/2] uncrustify: remove newlines after return type of function prototype X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel,1/2] reformat: remove newline after return type of function prototype
|
|
Commit Message
Frank Lichtenheld
Aug. 18, 2022, 10:15 a.m. UTC
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
dev-tools/uncrustify.conf | 1 +
1 file changed, 1 insertion(+)
Comments
yes! This is what we need!
Acked-by: Antonio Quartulli <a@unstable.cc>
Am 18.08.22 um 22:43 schrieb Antonio Quartulli: > yes! This is what we need! > > Acked-by: Antonio Quartulli <a@unstable.cc> > I am out of the loop here. Could you two explain why we need this? I.e. what is wrong with the current style is and what the plan is to change? If often struggle to properly format function with the soft limit of 80 without being allowed to put the return type on a separate line. So I am not sure what the improvement of this change is. Arne
Hi, On 19/08/2022 11:50, Arne Schwabe wrote: > Am 18.08.22 um 22:43 schrieb Antonio Quartulli: >> yes! This is what we need! >> >> Acked-by: Antonio Quartulli <a@unstable.cc> >> > > I am out of the loop here. Could you two explain why we need this? I.e. > what is wrong with the current style is and what the plan is to change? > > If often struggle to properly format function with the soft limit of 80 > without being allowed to put the return type on a separate line. So I am > not sure what the improvement of this change is. > We are not changing the style here. Basically we have originally started using this approach (when we discussed the style back with Steffan some years ago): * prototypes: return type on the same line as the function name (makes the first line a bit longer, but normally is not a big deal). Should the line be too long to make the name fit within the 100chars limit we have, you can still go to a new line, but should really be an exception. * function definitions: return type on its own line. Basically it's just a matter of style, not convenience. Note: this has been like this since a while. Only a few occurrences were not respecting this style (and Frank is fixing those in 1/2). Cheers, > Arne
Hi, On Fri, Aug 19, 2022 at 11:50:04AM +0200, Arne Schwabe wrote: > Am 18.08.22 um 22:43 schrieb Antonio Quartulli: > > yes! This is what we need! > > > > Acked-by: Antonio Quartulli <a@unstable.cc> > > I am out of the loop here. Could you two explain why we need this? I.e. > what is wrong with the current style is and what the plan is to change? > > If often struggle to properly format function with the soft limit of 80 > without being allowed to put the return type on a separate line. So I am > not sure what the improvement of this change is. This is the conclusion that I arrived to as well, when reviewing the changes in 1/2. Forcing the prototype on the return type while at the same time permitting enums, structs, etc., will cause cases like enum some_special_type special_function_with_descriptive_name(int arg1, char * arg2); which is definitely less readable than enum some_special_type special_function_with_descriptive_name(int arg1, char * arg2); or maybe enum some_special_type special_function_with_descriptive_name(int arg1, char * arg2); Now, for other cases, int somefunc(void); I find the other style int somefunc(void); much easier to grok ("have a single look and see what this is about"). ... so, my suggestion is that we permit both styles for function prototypes, based on overall type + function name + parameter length. It would be cool if uncrustify had a magic flag for that, like "if return type + function name is < 40 characters, put on a single line, and if over, split" :-) Am I making sense? gert
On Fri, Aug 19, 2022 at 12:18:06PM +0200, Gert Doering wrote: > Hi, [...] > It would be cool if uncrustify had a magic flag for that, like "if > return type + function name is < 40 characters, put on a single line, > and if over, split" :-) Pretty sure there is nothing like that. So should we mark this patch just as rejected in patchwork and move on? > Am I making sense? I understand your reasoning. I wouldn't agree that it is worth clinging to a style that can't be enforced just because it is slightly prettier. But definitely not going to waste further time arguing about this specific bikeshed ;) Regards,
diff --git a/dev-tools/uncrustify.conf b/dev-tools/uncrustify.conf index 325f3108..c73fba0c 100644 --- a/dev-tools/uncrustify.conf +++ b/dev-tools/uncrustify.conf @@ -40,6 +40,7 @@ sp_after_comma=add pos_arith=Lead pos_bool=Lead nl_func_type_name=add +nl_func_proto_type_name=remove nl_before_case=true nl_assign_leave_one_liners=true nl_enum_leave_one_liners=true