From patchwork Sun Aug 3 15:01:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4349 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6302:b0:671:5a2c:6455 with SMTP id a2csp862813maf; Sun, 3 Aug 2025 08:02:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQ3ZgmojEjRWcxfrqZzuVCZD3xdihAhBM23RsLePDI85Xhqp53MHkGa2DueHcKIfrCehm8xhnNSrE=@openvpn.net X-Google-Smtp-Source: AGHT+IF6skZJjFsnOVMzRrVFzbk9BVphaJ7FumS4jgxaQk6F1GC7dkIaPHrjTNNG4qk8VThUeoeE X-Received: by 2002:a05:6870:8a0a:b0:302:523a:1799 with SMTP id 586e51a60fabf-30b675ff74dmr3031514fac.11.1754233328646; Sun, 03 Aug 2025 08:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1754233328; cv=none; d=google.com; s=arc-20240605; b=XyBRmt/pERjZEjTH2Kxg//VVd37+uef9AE329Wb1ceob4jjofsR1YIkmJkNsnX3TK5 Dif8WBfjTsj3uQyaNnBUKVBlpW0CwFAHSrJWOQ5cNtvidfFxGVQoBxvNJs4ceMvBD3Bf g/7mvcNcF049rrPFkgPLL15lXMsiyTh0yA6KJMYo213G0OqIAa8Lngt62d+wIwYO9Nwx pUpFjdFXXn4E5hJ1owQtVIyc1J7GTGI2k9M1ZgYkptgo8o9euha6jXPFEbl3kslobf2P HNhgOwt8dubVmVv5w1x6vmHVXTLI2emnjuO3tEXGnY0kJ0k6qgelVCBO7yd4Vglk57pz 0N8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=iAIK0WZQil/3oecMKS+5jQI8E2Tq/kEXNwb9KoSLGSM=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=gjJ1ozKCftHc3Uu9bDhEDyGTzhEX+pzlR4W3S2pC9albNCTGNSrixvnBuZzC/Cjpjr 2eDpmJHb0ZhFrz9XaYFp6oUIZFFNtUHsFYEvvLEvy8XyDNSbHzsIf9hqGyXLG3HM88iq Yvc64zVtDReZb2M1hCVaAahuZeOBbuxn4HapzQxmmNXuAOo8+OhSzBFrTJDjlEUTbPyf x01YLlqXeqwy9I4Lyp4FFNirchkvXAk9rbOP67gk7dNVPy7hrXrbdXkRBwvX9j3L5W/n HahA74+6ruFoELJqq1jTgAcepzI2joLbI5s1zXobjqYkvsh55qGrwqP6OjDxY14QSgi4 o4zQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=CEOzkGSV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=hdR62wi4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Clt3pM6I; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-30b81537a6fsi642727fac.73.2025.08.03.08.02.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Aug 2025 08:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=CEOzkGSV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=hdR62wi4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Clt3pM6I; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iAIK0WZQil/3oecMKS+5jQI8E2Tq/kEXNwb9KoSLGSM=; b=CEOzkGSVxrriNaUvJRRnNHZuOR vvPuNEtcScfjl/Vp6ZULmjmqP41dbuzMCU8nKCgqwHzYaD7EzJ0KRv+gB3Rvlvfyjat2aKbxIBfp/ t7yghHfb0wzlJjDsGhW9Yoyb9q5r2idbpDCGxgXcrEo9YBWWWMEuRsaLmoUMsdmYC1wc=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uiaDr-0002YP-Ao; Sun, 03 Aug 2025 15:02:04 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uiaDq-0002YJ-3J for openvpn-devel@lists.sourceforge.net; Sun, 03 Aug 2025 15:02:02 +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=04WP2lCs23C3PMwnTfzPxmLTa0R7jzPGX095yJjU0A4=; b=hdR62wi481qowBnVgHD36H3tk9 0jax6YU4giz1exiwAVnprrOSBP+Wh2Pmk99B6rw7jYYOGR5QfOjhuruJKRyHEupVhODUUPdCz0tTt wsZu0POjg87gjqvFX20vsDmRiOV/GZHcuOWhvhrIgusyTA+wsebLqdkRD1Vh2FSdCbL0=; 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=04WP2lCs23C3PMwnTfzPxmLTa0R7jzPGX095yJjU0A4=; b=Clt3pM6I9oWNzfkwKPlPLMBsym otPXsDP62mqCxAVfJa5ZEXEdAcsDZMQZQAffI4BTY+QinjJppswbpn1k/mcwxJOB3GbQ/QuNr8uFw ypOZ9gJZsAjz5MpVi81IIJfO/6OBrFPJmx7u85BA3Fcy6W2y/7mWgVg2cAMC27yWIJx8=; Received: from [193.149.48.143] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uiaDq-0007NC-0y for openvpn-devel@lists.sourceforge.net; Sun, 03 Aug 2025 15:02:02 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 573F1ouG003991 for ; Sun, 3 Aug 2025 17:01:50 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.17.1.9/Submit) id 573F1ojS003990 for openvpn-devel@lists.sourceforge.net; Sun, 3 Aug 2025 17:01:50 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 3 Aug 2025 17:01:37 +0200 Message-ID: <20250803150143.3878-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: From: Frank Lichtenheld Each of these statements has been reviewed but not all of them are obvious. Also add a pre-commit config to easily check the formatting. Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uiaDq-0007NC-0y Subject: [Openvpn-devel] [PATCH v18] Define a .clang-format file for the project X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1839446966548939548?= X-GMAIL-MSGID: =?utf-8?q?1839446966548939548?= From: Frank Lichtenheld Each of these statements has been reviewed but not all of them are obvious. Also add a pre-commit config to easily check the formatting. Change-Id: I40f6af10c5ee2f5aed4185d783fc622a2e3c19ff Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/790 This mail reflects revision 18 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..c314fca --- /dev/null +++ b/.clang-format @@ -0,0 +1,51 @@ +--- +BasedOnStyle: Mozilla +AccessModifierOffset: '-4' +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: + Enabled: true + AcrossEmptyLines: false + AcrossComments: true +AlignEscapedNewlines: Left +AlignOperands: true +AlignTrailingComments: + Kind: Always + OverEmptyLines: 1 +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +BinPackArguments: true +BinPackParameters: true +BreakAfterReturnType: AllDefinitions +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Allman +BreakBeforeTernaryOperators: true +BreakStringLiterals: false +ColumnLimit: '100' +ContinuationIndentWidth: '4' +DerivePointerAlignment: false +IndentCaseLabels: true +IndentGotoLabels: false +IndentWidth: '4' +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: '2' +PointerAlignment: Right +ReflowComments: true +SortIncludes: false +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpacesBeforeTrailingComments: '2' +SpacesInParens: Never +TabWidth: '4' +TypeNames: [DWORD] +UseTab: Never +WhitespaceSensitiveMacros: [_STRINGIFY] +--- +Language: C +--- +Language: Cpp diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c1bca47 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: 'v20.1.0' + hooks: + - id: clang-format + files: \.[ch]$ + # preserve upstream formatting + exclude: ^(src/compat/compat-lz4\.[ch]|src/openvpn/ovpn_dco_(linux|win)\.h)$