From: "flichtenheld (Code Review)" Date: Wed, 19 Mar 2025 14:21:58 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <8dd10d25af752f122403842c6072ea8a8219a3d5-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="vjuyGsnr4uU="; 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: plaisthos Cc: openvpn-devel --vjuyGsnr4uU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/790?usp=3Demail to review the following change. 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 --- A .clang-format A .pre-commit-config.yaml 2 files changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/790/9 diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..0960fe7 --- /dev/null +++ b/.clang-format @@ -0,0 +1,46 @@ +--- +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 +AlwaysBreakAfterReturnType: None +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeBraces: Allman +BreakBeforeTernaryOperators: true +BreakStringLiterals: false +ColumnLimit: '100' +ContinuationIndentWidth: '4' +DerivePointerAlignment: false +IndentCaseLabels: true +IndentGotoLabels: false +IndentWidth: '4' +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +Language: Cpp +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] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0f09a06 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: 'v19.1.4' + 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: 9 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --vjuyGsnr4uU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

Define a .clang-format file for the project

Each of th= ese statements has been reviewed but
not all of them are obvious.
Also add a pre-commit config to easily check the
formatting.

Cha= nge-Id: I40f6af10c5ee2f5aed4185d783fc622a2e3c19ff
Signed-off-by: Frank L= ichtenheld <frank@...2641...>
---
A .clang-format
A .pre-com= mit-config.yaml
2 files changed, 54 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/790/9
diff --git a/.clang-format b/.clang-format
new file = mode 100644
index 0000000..0960fe7
--- /dev= /null
+++ b/.clang-format
@@ -0,0 +1,46 @@<= /span>
+---
+BasedOnStyle: Mozilla
+AccessModifierOffset: '-4'=

+AlignAfterOpenBrack= et: Align
+AlignConse= cutiveMacros:
+ Enab= led: true
+ AcrossEm= ptyLines: false
+ Ac= rossComments: true
+A= lignEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnAS= ingleLine: false
+All= owShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false<= /span>
+AlwaysBreakAfterRetu= rnType: None
+BreakBe= foreBinaryOperators: NonAssignment
+BreakBeforeBraces: Allman
+BreakBeforeTernaryOperators: true
+BreakStringLiterals: false
+ColumnLimit: '100'
=
+ContinuationIndentWidth: &= #39;4'
+DerivePoi= nterAlignment: false
= +IndentCaseLabels: true
+IndentGotoLabels: false
+IndentWidth: '4'
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false+Language: Cpp
+MaxEmptyLinesToKeep: '2'
+PointerAlignment: Rig= ht
+ReflowComments: t= rue
+SortIncludes: fa= lse
+SpaceAfterCStyle= Cast: false
+SpaceBef= oreAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpacesBeforeTrailingComments: '2'<= br>+SpacesInParens: Never
+TabWidth: '4'
+TypeNames: [DWORD]

+UseTab: Never
= +WhitespaceSensitiveMacros: [_S= TRINGIFY]
diff --git a/.pre-commit-config.yaml b/.pre-commi= t-config.yaml
new file mode 100644
index 00= 00000..0f09a06
--- /dev/null
+++ b/.pre-com= mit-config.yaml
@@ -0,0 +1,8 @@
+repos:
+ - repo: https://github.com/pre-commit/mirrors-clang-format=
+ rev: 'v19.1= .4'
+ hooks:
+ - id: clang-for= mat
+ files: \= .[ch]$
+ # pre= serve upstream formatting
+ exclude: ^(src/compat/compat-lz4\.[ch]|src/openvpn/ovpn_dco_(= linux|win)\.h)$

To view, visit change 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: 9
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--vjuyGsnr4uU=--