On Fri, Mar 24, 2023 at 03:53:25PM +0000, Bruce Richardson wrote: > On Wed, Mar 22, 2023 at 10:06:54AM -0700, Stephen Hemminger wrote: > > Based off of Linux kernel style with some local modifications > > and DPDK foreach macros. > > > > A couple of open questions to be resolved befor merging. > > Is GPL license ok for config file (inherited from Linux here)? > > Do we want to have per-driver files for some drivers (like MLX5)? > > > > Signed-off-by: Stephen Hemminger <step...@networkplumber.org> > > --- > > .clang-format | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 181 insertions(+) > > create mode 100644 .clang-format > > > > diff --git a/.clang-format b/.clang-format > > new file mode 100644 > > index 000000000000..ad4d30520253 > > --- /dev/null > > +++ b/.clang-format > > @@ -0,0 +1,181 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +# > > +# clang-format configuration file. Intended for clang-format >= 11. > > +# > > +# For more information, see: > > +# > > +# Documentation/process/clang-format.rst > > +# https://clang.llvm.org/docs/ClangFormat.html > > +# https://clang.llvm.org/docs/ClangFormatStyleOptions.html > > +# > > +--- > > +AccessModifierOffset: -4 > > +AlignAfterOpenBracket: Align > > This may be partially a matter of personal preference, but I disagree with > using this setting. This sets up line continuations with varaible widths, > and leads to: > * continuation lines being very short if the function name in a wrapped > call is long > * indentation using a mix of tabs and spaces as it tries to line up exactly > on a column with brackets
+1 i find alignment to open bracket terrible. it also blows out to multiple line diffs if something like a function name is changed and there are parameters on following lines. > > I think a better option for this setting, which is also aligned with our > coding rules, is for this to be set to "DontAlign" and the > "ContinuationIndentWidth" set to 16, leading to double-tab continuations > (at least in my testing). > > /Bruce