Module Name: src Committed By: martin Date: Thu Sep 12 20:12:10 UTC 2024
Modified Files: src/distrib/sets/lists/base [netbsd-10]: mi src/share/misc [netbsd-10]: Makefile Added Files: src/share/misc [netbsd-10]: dot.clang-format Log Message: Pull up following revision(s) (requested by rin in ticket #854): distrib/sets/lists/base/mi: revision 1.1349 share/misc/dot.clang-format: revision 1.1 share/misc/Makefile: revision 1.41 Add basic clang-format configuration file for NetBSD sources. To generate a diff of this commit: cvs rdiff -u -r1.1314.2.8 -r1.1314.2.9 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.38.26.1 -r1.38.26.2 src/share/misc/Makefile cvs rdiff -u -r0 -r1.1.2.2 src/share/misc/dot.clang-format Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/base/mi diff -u src/distrib/sets/lists/base/mi:1.1314.2.8 src/distrib/sets/lists/base/mi:1.1314.2.9 --- src/distrib/sets/lists/base/mi:1.1314.2.8 Thu Sep 5 09:22:42 2024 +++ src/distrib/sets/lists/base/mi Thu Sep 12 20:12:10 2024 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1314.2.8 2024/09/05 09:22:42 martin Exp $ +# $NetBSD: mi,v 1.1314.2.9 2024/09/12 20:12:10 martin Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -5048,6 +5048,7 @@ ./usr/share/misc/acronyms.comp base-reference-share share ./usr/share/misc/ascii base-reference-share share ./usr/share/misc/bsd-family-tree base-reference-share share +./usr/share/misc/dot.clang-format base-reference-share share ./usr/share/misc/getopt base-obsolete obsolete ./usr/share/misc/magic base-obsolete obsolete ./usr/share/misc/magic.mgc base-magic-share share Index: src/share/misc/Makefile diff -u src/share/misc/Makefile:1.38.26.1 src/share/misc/Makefile:1.38.26.2 --- src/share/misc/Makefile:1.38.26.1 Wed Aug 9 16:23:10 2023 +++ src/share/misc/Makefile Thu Sep 12 20:12:10 2024 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.38.26.1 2023/08/09 16:23:10 martin Exp $ +# $NetBSD: Makefile,v 1.38.26.2 2024/09/12 20:12:10 martin Exp $ # @(#)Makefile 8.1 (Berkeley) 6/8/93 FILES= NetBSD.el acronyms acronyms-o acronyms.comp airport ascii \ birthtoken bsd-family-tree \ - country domains operator \ + country domains dot.clang-format operator \ eqnchar flowers indent.pro inter.phone language man.template \ mdoc.template na.phone na.postal style zipcodes FILESDIR=${BINDIR}/misc Added files: Index: src/share/misc/dot.clang-format diff -u /dev/null src/share/misc/dot.clang-format:1.1.2.2 --- /dev/null Thu Sep 12 20:12:10 2024 +++ src/share/misc/dot.clang-format Thu Sep 12 20:12:10 2024 @@ -0,0 +1,45 @@ +# $NetBSD: dot.clang-format,v 1.1.2.2 2024/09/12 20:12:10 martin Exp $ +# +# This is a base for using clang-format with NetBSD sources. +# +# /usr/share/misc/style has more details, some of which cannot be +# captured here. +# +# To use it, rename it to .clang-format and put it in the directory +# you're editing, or call clang-format with the --style argument: +# +# clang-format --style=file:/usr/share/misc/dot.clang-format [...] file.c +# +# 80 characters line length +ColumnLimit: 80 +# if comments get too long, fmt them. +ReflowComments: true +# default indentation level +IndentWidth: 8 +# also for struct initializers +BracedInitializerIndentWidth: 8 +# prefer using tabs to spaces when indenting +UseTab: ForContinuationAndIndentation +# indent 1 space more per #if-level +PPIndentWidth: 1 +# and put the space after the hash but before the keyword (i.e., "# if") +IndentPPDirectives: AfterHash +# backslashes at end-of-line are aligned, but as far left as possible +AlignEscapedNewlines: Left +# not supported in clang-format 18, would include the last line (without backslash) in the offset consideration +#AlignEscapedNewlines: LeftWithLastLine +# +# if function arguments get too long, start new line indented by 4 +AlignAfterOpenBracket: DontAlign +ContinuationIndentWidth: 4 +# but keep first parameters on the first line +AllowAllParametersOfDeclarationOnNextLine: False +AllowAllArgumentsOnNextLine: false +# for struct's etc. use 8 characters indent as well +ConstructorInitializerIndentWidth: 8 +# attach "{", except for functions +BreakBeforeBraces: WebKit +# for functions, add newline after return type +AlwaysBreakAfterReturnType: TopLevelDefinitions +# align structure elements to the right +AlignArrayOfStructures: Right