From patchwork Fri Dec 16 18:25:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RWR3aW4gVMO2csO2aw==?= X-Patchwork-Id: 13075271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB277C4167B for ; Fri, 16 Dec 2022 18:25:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.464883.723417 (Exim 4.92) (envelope-from ) id 1p6FP1-0006uD-L5; Fri, 16 Dec 2022 18:25:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 464883.723417; Fri, 16 Dec 2022 18:25:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p6FP1-0006u6-II; Fri, 16 Dec 2022 18:25:47 +0000 Received: by outflank-mailman (input) for mailman id 464883; Fri, 16 Dec 2022 18:25:46 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p6FP0-0006tv-Ep for xen-devel@lists.xenproject.org; Fri, 16 Dec 2022 18:25:46 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0cacc7ac-7d6f-11ed-8fd4-01056ac49cbb; Fri, 16 Dec 2022 19:25:44 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0cacc7ac-7d6f-11ed-8fd4-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1671215144; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SK6xSKqseYAyljVhQuyH2yP+rYs8EJtjkFWvFQgviSY=; b=cZe3nr4fy40GAQc2XOkQykNfjSzEfS1tMT/4b/Z63lNHcgK10Z8eEYpK +KyHf82OhCftcy+a0ul58YTB1EKBxpcj5UQbfdS2Vt58JW5Xcvk5mLxvw E6mRH7CcxL4LhW9bPG5cmm+mBGfW/S/i7R5oJ8GKx/zwFqBjUgNLJgu8e o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 88800464 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:eD6EAa8M3DOeBEqwWNGHDrUDjn6TJUtcMsCJ2f8bNWPcYEJGY0x3x mNKDGCOOffbYGGgL9wgPtixph8DvMTdnNNgHgRrrCs8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIx1BjOkGlA5AZnP6kV5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklC6 6VGch8OaCml2cSf0LaGGvkro9kaeZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGM0Yn1lQ/UfrSmM+limf+dXtEr0iSpoI84nTJzRw327/oWDbQUozaFZ0NwhjEz o7A13bYWTwGFNW28Dii/nOyvOGVrCOqfLtHQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFaItwARc8BdGOo77EeK0KW8yxmdLngJSHhGctNOiSMtbWV0j BnTxYqvXGEx9u3OIZ6AyluKhT+sYHZPAmwEXAlaayIV5+SzsMYWkyuaG76PD5WJptHyHDjxx RWDoy4/m6gfgKY36kmrwbzUq2ny/8aUF2bZ8i2SBzv4tV0hOOZJcqTysTDmAeB8wJF1p7Vrl FwNgICg4e8HFvlhfwTdEbxWTNlFCxtoWQAwYGKD/bF7r1xBGFb5J+i8BQ2Sw283WvvogRezP CfuVfp5vfe/xkeCY65teJ6WAM8316XmHtmNfqmKMYMXOMkoJV/foH8GiausM4fFyRhErE3CE c3DLZbE4YgyV8yLMwZat89CiOR2l0jSNEvYRIzhzgTP7FZtTCf9dFvxC3PXNrpRxPrd8G3oH yN3a5PiJ+N3DLevPUE6MOc7cTg3EJTMLcyu+pEKKrPdfVoO9aNII6a5/I7NsrdNx8x9/tokN FnnMqOE4DITXUH6FDg= IronPort-HdrOrdr: A9a23:dyk33q81/gVqBaMH6zpuk+A/I+orL9Y04lQ7vn2ZHyYlFPBw9v rAoB1/73XJYVkqNE3I9erwQ5VoBEmsjaKdgrN+AV7BZniAhILyFvAB0WKK+VSJJ8S9zJ8/6U 4HSdkaNDSaNykCsS+V2mSFOudl6MSDtJi1ifvT71oFd3ARV4hQqy9lDw6ACE1/Q01jDZo9UL 6R/NBOqTblWXl/VKWGL0hAd/XHr8fQlJrgJToPBxti1RKHiimh4qP7FR/d/hp2aVNyKblLyx mgr+Wo3M6ej80= X-IronPort-AV: E=Sophos;i="5.96,249,1665460800"; d="scan'208";a="88800464" From: =?utf-8?b?RWR3aW4gVMO2csO2aw==?= To: CC: =?utf-8?b?RWR3aW4gVMO2csO2aw==?= , Christian Lindig , David Scott , Wei Liu , Anthony PERARD Subject: [PATCH v4 06/11] tools/ocaml: add .clang-format Date: Fri, 16 Dec 2022 18:25:15 +0000 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Add a .clang-format configuration that tries to match CODING_STYLE where possible. I was not able to express the special casing of braces after 'do' though, this can only be controlled generally for all control statements. It is imperfect, but should be better than the existing bindings, which do not follow Xen coding style. Add this to tools/ocaml first because: * there are relatively few C files here, and it is a good place to start with * it'd be useful to make these follow Xen's CODING_STYLE (which they currently do not because they use tabs for example) * they change relatively infrequently, so shouldn't cause issues with backporting security fixes (could either backport the reindentation patch too, or use git cherry-pick with `-Xignore-space-change`) Does not yet reformat any code. No functional change. Signed-off-by: Edwin Török Acked-by: Christian Lindig --- Changes since v1: * change commit title to reflect this is for OCaml subtree only * don't mention stdint.h here, that may be fixed in a different way elsewhere * add Acked-by line --- tools/ocaml/.clang-format | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tools/ocaml/.clang-format diff --git a/tools/ocaml/.clang-format b/tools/ocaml/.clang-format new file mode 100644 index 0000000000..7ff88ee043 --- /dev/null +++ b/tools/ocaml/.clang-format @@ -0,0 +1,9 @@ +BasedOnStyle: GNU +IndentWidth: 4 + +# override GNU to match Xen ../../CODING_STYLE more closely +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +SpacesInConditionalStatement: true +SpaceBeforeParens: ControlStatements +BreakBeforeBraces: Allman