From nobody Sun Apr 28 19:06:32 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1563461071; cv=none; d=zoho.com; s=zohoarc; b=O3Tna3V4/1r/U1YELMxjbjSKRvNO6zb59qpZUxbUa+niQ+GU8z3MwBFOWBHjT5RZ47qK86dM17zBndnNPzd1DkvPJxoLMroU+vcm5bQ8AV6QbjuEqQoN5ClKhc9t6YoLd1smPaePjMt9c/HzSt2QswhjUyVB2m7him8/IoCl5qk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563461071; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=Rg2huZ3GVGgXE0tR/KETdrZzrX1/0Ok7AOmA6kWePc8=; b=WX7pyLV+IchBhLhL2SI0DkudbY46uhs6B9Yu6jhCvjyaY3mMGux8M1Ysi/QUlSI4b3yB/Hb0N6jgK2LFdjOXkcIHxWcsSWl5W/mCETVHXAze4Efn1FF9eT6X0aJ9ZpCpBJgv1xmvHNOqD0CYtn9YdzjspIqrRwWqJfiQFKBbWnQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1563461071378998.9846193746472; Thu, 18 Jul 2019 07:44:31 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ho7cx-0007kO-Vm; Thu, 18 Jul 2019 14:43:23 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ho7cw-0007kJ-OU for xen-devel@lists.xenproject.org; Thu, 18 Jul 2019 14:43:22 +0000 Received: from mail-io1-f68.google.com (unknown [209.85.166.68]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 63de6223-a96a-11e9-8980-bc764e045a96; Thu, 18 Jul 2019 14:43:22 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id m24so51861988ioo.2 for ; Thu, 18 Jul 2019 07:43:21 -0700 (PDT) Received: from l1.lan (c-71-205-12-124.hsd1.co.comcast.net. [71.205.12.124]) by smtp.gmail.com with ESMTPSA id t5sm23119176iol.55.2019.07.18.07.43.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 07:43:20 -0700 (PDT) X-Inumbo-ID: 63de6223-a96a-11e9-8980-bc764e045a96 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4h6hORWfsY6uu4me1CjMW8Zu+wBYhPWvFpHkD7dVcv8=; b=lHtnroL3L7r14QhUnYUgvCGwLgZGSxpnKBJseClRnp0kJtNp5zP9HO2Fovjqy55ztd 97rp1MVyKZBPnY2x+glux2ScyrXPqvWzn0Y090PSOXVQC4nFzCWHIobxvdQTzO9DvSfZ 1DgQEjSWy7DUnAFzT7GhmBvO+I6c8+eC2+dMknw1MW1BscR07T7qHLBCJgB5UO2Y5GJF SPkP8Kl4dTGWmddguxGDrYSlqe18YMRFYG2QYWHKovbXLCBZcnRGQqZSFoOg701x/+Hj mvFZoiofFhMECu7Wabp/7/BoY/CwKEJaLgzWyauU4RZBY/stpVFRHc3EqXlUqG6hdfdN AE9A== X-Gm-Message-State: APjAAAVIZrloL8zRVpJ+XDY44sbszDpayHuAVimJB5o5eXUZ8yTsXwih c31EhtmkjTHbEuiQkTvfkPXHnEOy X-Google-Smtp-Source: APXvYqyHU4lY78koz1iZ8w/9BtHUhm8HmrjcaCIdXn7UZfapfTSaqdJGwsMDm3zPcYYVAgfps+VUpw== X-Received: by 2002:a6b:1ca:: with SMTP id 193mr45224979iob.264.1563461001288; Thu, 18 Jul 2019 07:43:21 -0700 (PDT) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Thu, 18 Jul 2019 08:43:17 -0600 Message-Id: <20190718144317.23307-1-tamas@tklengyel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [RFC] xen: Add .astylerc for automated style-formatting X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Tamas K Lengyel , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Stefano Stabellini , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Using astyle (http://astyle.sourceforge.net) can greatly reduce the overhea= d of manually checking and applying style-fixes to source-code. The included .astylerc is the closest approximation of the established Xen style (includ= ing styles not formally spelled out by CODING_STYLE but commonly requested). Checking the comment styles are not included in the automation. Incorporating Xen's exception to the do-while style is only partially possi= ble, thus a change is proposed to the CODING_STYLE of moving the brace from "do = {" to the next line. Most of Xen's code-base is non-conforming at the moment: 289 files pass unchanged, 876 have some style issues. Ideally we can slowly migrate the entire code-base to be conforming, thus eliminating the need of discussing and enforcing style issues manually on t= he mailinglist. Signed-off-by: Tamas K Lengyel --- .astylerc | 14 ++++++++++++++ CODING_STYLE | 18 +++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .astylerc diff --git a/.astylerc b/.astylerc new file mode 100644 index 0000000000..bbd1d55ddd --- /dev/null +++ b/.astylerc @@ -0,0 +1,14 @@ +style=3Dbsd +suffix=3Dnone +align-pointer=3Dname +align-reference=3Dname +indent=3Dspaces=3D4 +max-code-length=3D80 +min-conditional-indent=3D0 +attach-closing-while +remove-braces +indent-switches +break-one-line-headers +keep-one-line-blocks +pad-comma +pad-header diff --git a/CODING_STYLE b/CODING_STYLE index 6cc5b774cf..0b37f7ae4d 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -60,8 +60,8 @@ Bracing ------- =20 Braces ('{' and '}') are usually placed on a line of their own, except -for the do/while loop. This is unlike the Linux coding style and -unlike K&R. do/while loops are an exception. e.g.: +for the while-part of do/while loops. This is unlike the Linux coding sty= le +and unlike K&R. do/while loops are an exception. e.g.: =20 if ( condition ) { @@ -77,7 +77,8 @@ while ( condition ) /* Do stuff. */ } =20 -do { +do +{ /* Do stuff. */ } while ( condition ); =20 @@ -120,3 +121,14 @@ the end of files. It should be: * indent-tabs-mode: nil * End: */ + +Automated style formatting using astyle +--------------------------------------- + +The .astylerc included in the Xen tree incorporates most of Xen's +style requirements, except the formatting of comments. + +The steps to automatically format a file are: + +export ARTISTIC_STYLE_OPTIONS=3D".astylerc" +astyle --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel