From: "flichtenheld (Code Review)"
Date: Wed, 30 Apr 2025 13:00:29 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
openvpn-devel@lists.sourceforge.net
Message-ID: <3339f231eab43bb6598f4949c1a3c4fbe87cc391-EmailReplacePatchSet-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="dl5B1gamy0I="; 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
--dl5B1gamy0I=
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 reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/790?usp=3Demail
to look at the new patch set (#13).
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, 59 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/790/13
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..b95d58d
--- /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
+AlwaysBreakAfterReturnType: None
+BinPackArguments: true
+BinPackParameters: true
+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: 13
Gerrit-Owner: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-MessageType: newpatchset
--dl5B1gamy0I=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: plaisthos.
flichtenheld uploaded patch set #13 to this change.
=
View C=
hange
Define a .clang-format file for the project
Each of these =
statements has been reviewed but
not all of them are obvious.
Als=
o add a pre-commit config to easily check the
formatting.
Change-=
Id: I40f6af10c5ee2f5aed4185d783fc622a2e3c19ff
Signed-off-by: Frank Licht=
enheld <frank@...2641...>
---
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/13
diff --git a/.clang-format b/.clang-format
new file mod=
e 100644
index 0000000..b95d58d
--- /dev/nu=
ll
+++ b/.clang-format
@@ -0,0 +1,51 @@
+---
+BasedOnStyle: Mozilla
+AccessModifierOffset: '-4'
+AlignAfterOpenBracket:=
Align
+AlignConsecut=
iveMacros:
+ Enabled=
: true
+ AcrossEmpty=
Lines: false
+ Acros=
sComments: true
+Alig=
nEscapedNewlines: Left
+AlignOperands: true
+AlignTrailingComments:
+ Kind: Always
=
+ OverEmptyLines: 1
=
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: Never
+AllowShortCaseLabelsOnASingle=
Line: false
+AllowSho=
rtFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnTyp=
e: None
+BinPackArgum=
ents: true
+BinPackPa=
rameters: true
+Break=
BeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: Allman
+BreakBeforeTernaryOperators: true
+BreakStringLiterals: false
<=
span style=3D"color: hsl(120, 100%, 40%);">+ColumnLimit: '100'
+ContinuationIndentWidth:=
'4'
+DeriveP=
ointerAlignment: false
+IndentCaseLabels: true
+IndentGotoLabels: false
+IndentWidth: '4'
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: false=
+MaxEmptyLinesToKeep: '=
2'
+PointerAlignm=
ent: Right
+ReflowCom=
ments: true
+SortIncl=
udes: false
+SpaceAft=
erCStyleCast: false
+=
SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpacesBeforeTrailingComments: '2'=
+SpacesInParens: Nev=
er
+TabWidth: '4&=
#39;
+TypeNames: [DWO=
RD]
+UseTab: Never
+WhitespaceSensitiveMac=
ros: [_STRINGIFY]
+--=
-
+Language: C=
+---
+Language: Cpp
diff --git =
a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new fil=
e mode 100644
index 0000000..c1bca47
--- /d=
ev/null
+++ b/.pre-commit-config.yaml
@@ -0=
,0 +1,8 @@
+repos:
+ - repo: https://gith=
ub.com/pre-commit/mirrors-clang-format
+ rev: 'v20.1.0'
+ hooks:
+ - id: clang-format
+ files: \.[ch]$
+ # preserve upstream formatting
<=
span style=3D"color: hsl(120, 100%, 40%);">+ exclude: ^(src/compat/c=
ompat-lz4\.[ch]|src/openvpn/ovpn_dco_(linux|win)\.h)$
To view, visit change 790. To unsubscribe, or for help writing ma=
il filters, visit settings=
a>.
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I40f6af10c5ee2f5aed4185d783f=
c622a2e3c19ff
Gerrit-Change-Number: 790
Gerrit-PatchSet: 13
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: newpatchset
--dl5B1gamy0I=--