From: "cron2 (Code Review)" Date: Mon, 4 Aug 2025 08:26:03 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Q5xZ2pJH8BU="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Define a .clang-format file for the project List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --Q5xZ2pJH8BU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#19) to the change originally created b= y flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/790?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Define a .clang-format file for the project ...................................................................... Define a .clang-format file for the project 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 Message-Id: <20250803150143.3878-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 484.html Signed-off-by: Gert Doering --- A .clang-format A .pre-commit-config.yaml 2 files changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/790/19 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)$ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/790?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I40f6af10c5ee2f5aed4185d783fc622a2e3c19ff Gerrit-Change-Number: 790 Gerrit-PatchSet: 19 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --Q5xZ2pJH8BU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #19 to the change originally c= reated by flichtenheld.

View Change

The following approvals got outd= ated and were removed: Code-Review+2 by cron2

Define a .clang-format file for the project

E= ach of these statements has been reviewed but
not all of them are obviou= s.

Also add a pre-commit config to easily check the
formatting.
Change-Id: I40f6af10c5ee2f5aed4185d783fc622a2e3c19ff
Signed-off-by= : Frank Lichtenheld <frank@...2641...>
Acked-by: Gert Doering <= gert@...1296...>
Message-Id: <20250803150143.3878-1-gert@...2132...= .>
URL: https://www.mail-archive.com/openvpn-devel@...290...= net/msg32484.html
Signed-off-by: Gert Doering <gert@...1296...>---
A .clang-format
A .pre-commit-config.yaml
2 files changed, 59= insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:=
29418/openvpn refs/changes/90/790/19
diff --git a/.clang-format b/.=
clang-format
new file mode 100644
index 000= 0000..c314fca
--- /dev/null
+++ b/.clang-fo= rmat
@@ -0,0 +1,51 @@
+---
+BasedOnStyle: Mozilla
+AccessModifierOffset: '-4'
+AlignAfterOpenBracket: Align
+AlignConsecutiveMacros:
+ Enabled: true
+ AcrossEmptyLines: false
+ AcrossComments: true
+AlignEscapedNewlines: Left+AlignOperands: true+AlignTrailingComments:=
+ Kind: Always
<= span style=3D"color: hsl(120, 100%, 40%);">+ OverEmptyLines: 1
<= span style=3D"color: hsl(120, 100%, 40%);">+AllowAllParametersOfDeclaration= OnNextLine: true
+All= owShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatement= sOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+BinPackArguments: true
+BinPackParameters: true
+BreakAfterReturnType: AllDefinitions
+BreakBeforeBinaryOperators: NonAs= signment

+BreakBefore= Braces: Allman
+Break= BeforeTernaryOperators: true
+BreakStringLiterals: false
+ColumnLimit: '100'
+ContinuationIndentWidth: '4'
+DerivePointerAlignment: false
+IndentCaseLabels: true
+IndentGotoLabels: fals= e
+IndentWidth: '= 4'
+IndentWrapped= FunctionNames: false
= +KeepEmptyLinesAtTheStartOfBlocks: false
+MaxEmptyLinesToKeep: '2'
+PointerAlignment: Right
+ReflowComments: true
+SortIncludes: false
+SpaceAfterCStyleCast: false+SpaceBeforeAssignmentOperato= rs: true
+SpaceBefore= Parens: ControlStatements
+SpacesBeforeTrailingComments: '2'
+SpacesInParens: Never
+TabWidth: '4'
+TypeNames: [DWORD]
+UseTab: Never
+WhitespaceSensitiveMacros: [_STRINGIFY]<= br>+---
+Language: C
+---
+Language: Cpp
diff --git a/.pre-commit-config.yam= l 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/mirror= s-clang-format
+ r= ev: 'v20.1.0'
+ hooks:
+ -= id: clang-format
+ = files: \.[ch]$
= + # preserve upstream formatting
+ exclude: ^(src/compat/compat-lz4\.[ch]|src/open= vpn/ovpn_dco_(linux|win)\.h)$

To view, = visit cha= nge 790. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I40f6af10c5ee2f5aed4185d783f= c622a2e3c19ff
Gerrit-Change-Number: 790
Gerrit-PatchSet: 19
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--Q5xZ2pJH8BU=--