diff --git a/.clang-format b/.clang-format index 41a7d109..57317e25 100644 --- a/.clang-format +++ b/.clang-format @@ -10,6 +10,7 @@ AllowShortLoopsOnASingleLine: false AlignEscapedNewlines: Left AlignArrayOfStructures: None PointerAlignment: Right +InsertBraces: true BreakBeforeBraces: Linux BreakBeforeBinaryOperators: None KeepEmptyLinesAtTheStartOfBlocks: false @@ -18,6 +19,8 @@ IndentWidth: 4 UseTab: Never SortIncludes: false ColumnLimit: 80 +# Const always to left side. +QualifierAlignment: Left --- Language: JavaScript DisableFormat: true diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..41d2338e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +root = true + +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 +# Currently project use git "* text=auto". +end_of_line = unset + +[CMakelists.txt] +indent_size = 2 + +[Dockerfile] +indent_size = 2 + +# Makefiles needs tabs. +[{Makefile,*.{mgw,mak,MAK}}] +indent_style = tab + +# Some project files. Saving might change files. +[*.{sln,atsln,layout}] +indent_style = tab +insert_final_newline = unset +[*.{,vcxproj*,props,cproj,tpi}] +insert_final_newline = unset + +[*.{yaml,yml}] +indent_size = 2 + +[*.{html,htm}] +indent_size = 2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e98f6360..46c3eec7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,6 +9,13 @@ on: - '*' jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 + scan-build: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..eb00be6a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,75 @@ +# Pre-commit is tool which we use to format and check this repository. This is +# also used in CI. You will still get nicer commits if you install it also +# locally. +# +# To install pre-commit run in repository root: +# pip install pre-commit +# pre-commit install +# +# To ignore pre-commit checks run: +# git commit --no-verify +# or +# pre-commit uninstall + +# Just in case exclude build and .git folders. Others are for external files. +exclude: build|\.git|external/|BACnet\-Server\.X/|tools/(avstack|check\-stack\-usage|memap)|test/ztest/ + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # v4.6.0 + hooks: + - id: check-merge-conflict + args: [--assume-in-merge] + # Editorconfig-checker does not care if file contains multiple newlines. + - id: end-of-file-fixer + exclude: '.*\.(cproj|vcxproj.*|props)$' + - id: check-yaml + args: [ + # for .clang-format + --allow-multiple-documents, + ] + - id: check-case-conflict + - id: check-shebang-scripts-are-executable + - id: fix-byte-order-marker + # Seems that VS files are using BOMs. + exclude: '.*\.(cproj|vcxproj.*|sln|atsln|props)$' + - id: trailing-whitespace + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: a30f0d816e5062a67d87c8de753cfe499672b959 # v1.5.5 + hooks: + - id: remove-tabs + name: Remove tabs (4 spaces) + args: ["--whitespaces-count", "4"] + exclude: \.(yaml|yml|html|htm|sln|atsln|layout)$|Makefile|\.(mgw|mak|MAK)$|Dockerfile$ + - id: remove-tabs + name: Remove tabs (2 spaces) + args: ["--whitespaces-count", "2"] + files: '.*\.(yaml|yml|html|htm)|Dockerfile$' + + # We will enable this in future. + # - repo: https://github.com/pre-commit/mirrors-clang-format + # rev: 3b03191b6a60cba0fc25c2dc2e30ea4854d897eb # v17.0.5 + # hooks: + # - id: clang-format + + # We might enable this in future. + # - repo: https://github.com/pre-commit/mirrors-prettier + # rev: ffb6a759a979008c0e6dff86e39f4745a2d9eac4 # v3.1.0 + # hooks: + # - id: prettier + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # v1.10.0 + hooks: + - id: text-unicode-replacement-char + + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: 1c48f639855b49be07ace8b824757152b6747baa #2.6.2 + hooks: + - id: editorconfig-checker + alias: ec + args: [ + # Saddly we have to disable this, but it just won't work. Maybe some day. + -disable-indent-size, + ] diff --git a/Makefile b/Makefile index 71f77103..fc8b8038 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,7 @@ ports: atmega168 bdk-atxx4-mstp at91sam7s stm32f10x stm32f4xx .PHONY: ports-clean ports-clean: atmega168-clean bdk-atxx4-mstp-clean at91sam7s-clean \ - stm32f10x-clean stm32f4xx-clean xplained-clean + stm32f10x-clean stm32f4xx-clean xplained-clean .PHONY: atmega168 atmega168: ports/atmega168/Makefile diff --git a/apps/Makefile b/apps/Makefile index 4efbc9e4..857cd3d1 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -154,7 +154,7 @@ WARNING_ALL += -Wunused-variable # since they are common in embedded WARNING_ALL += -Wno-sign-conversion -Wno-conversion -Wno-sign-compare WARNING_ALL += -Wno-long-long -Wno-attributes - # don't warn about implicit fallthrough since it's common in network protocols +# don't warn about implicit fallthrough since it's common in network protocols WARNING_ALL += -Wno-implicit-fallthrough #WARNING_ALL += -Werror WARNINGS ?= $(WARNING_ALL) diff --git a/ports/arduino_uno/Makefile b/ports/arduino_uno/Makefile index b996a6d7..4b0615af 100644 --- a/ports/arduino_uno/Makefile +++ b/ports/arduino_uno/Makefile @@ -190,9 +190,9 @@ lint: $(LINT) $(BFLAGS) $(CSRC) install: $(TARGET_ELF) - $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \ - -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -e \ - -U flash:w:$(TARGET).hex + $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \ + -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -e \ + -U flash:w:$(TARGET).hex ## Clean target .PHONY: clean diff --git a/ports/arduino_uno/external/Arduino/.clang-format b/ports/arduino_uno/external/Arduino/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/ports/arduino_uno/external/Arduino/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/arduino_uno/external/Arduino/.editorconfig b/ports/arduino_uno/external/Arduino/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/ports/arduino_uno/external/Arduino/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/ports/at91sam7s/.clang-format b/ports/at91sam7s/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/at91sam7s/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/atmega168/.clang-format b/ports/atmega168/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/atmega168/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/atmega168/Makefile b/ports/atmega168/Makefile index 37a8c142..03a66326 100644 --- a/ports/atmega168/Makefile +++ b/ports/atmega168/Makefile @@ -180,9 +180,9 @@ lint: $(LINT) $(BFLAGS) $(CSRC) install: $(TARGET_ELF) - $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \ - -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -e \ - -U flash:w:$(TARGET).hex + $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \ + -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -e \ + -U flash:w:$(TARGET).hex ## Clean target .PHONY: clean diff --git a/ports/bdk-atxx4-mstp/.clang-format b/ports/bdk-atxx4-mstp/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/bdk-atxx4-mstp/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/bdk-atxx4-mstp/.editorconfig b/ports/bdk-atxx4-mstp/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/ports/bdk-atxx4-mstp/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/ports/bdk-atxx4-mstp/external/.clang-format b/ports/bdk-atxx4-mstp/external/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/ports/bdk-atxx4-mstp/external/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/bsd/.clang-format b/ports/bsd/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/bsd/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/esp32/src/.clang-format b/ports/esp32/src/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/esp32/src/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/pic18f6720/.clang-format b/ports/pic18f6720/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/pic18f6720/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/pic18f97j60/.clang-format b/ports/pic18f97j60/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/pic18f97j60/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/stm32f10x/.clang-format b/ports/stm32f10x/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/stm32f10x/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/stm32f10x/.editorconfig b/ports/stm32f10x/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/ports/stm32f10x/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/ports/stm32f10x/external/.clang-format b/ports/stm32f10x/external/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/ports/stm32f10x/external/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/stm32f4xx/.clang-format b/ports/stm32f4xx/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/stm32f4xx/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/stm32f4xx/.editorconfig b/ports/stm32f4xx/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/ports/stm32f4xx/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/ports/stm32f4xx/external/.clang-format b/ports/stm32f4xx/external/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/ports/stm32f4xx/external/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/uip/.clang-format b/ports/uip/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/uip/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/win32/MAKEFILE.MAK b/ports/win32/MAKEFILE.MAK index 6229547e..e45820a8 100644 --- a/ports/win32/MAKEFILE.MAK +++ b/ports/win32/MAKEFILE.MAK @@ -87,7 +87,7 @@ install: $(PRODUCT_EXE) $(PRODUCT_EXE) : $(OBJS) @echo Running Linker for $(PRODUCT_EXE) $(LINK) -L$(C_LIB_DIR) -L$(BACNET_LIB_DIR) -m -c -s -v @&&| - $(BORLAND_DIR)\lib\c0x32.obj $** + $(BORLAND_DIR)\lib\c0x32.obj $** $< $*.map $(LIBS) diff --git a/ports/win32/rs485.mak b/ports/win32/rs485.mak index d2f75e6f..69e0fb0b 100644 --- a/ports/win32/rs485.mak +++ b/ports/win32/rs485.mak @@ -7,8 +7,8 @@ !ifndef BORLAND_DIR BORLAND_DIR_Not_Defined: - @echo . - @echo You must define environment variable BORLAND_DIR to compile. + @echo . + @echo You must define environment variable BORLAND_DIR to compile. !endif PRODUCT = rs485 @@ -59,7 +59,7 @@ all : $(BCC_CFG) $(PRODUCT_EXE) $(PRODUCT_EXE) : $(OBJS) @echo Running Linker for $(PRODUCT_EXE) $(LINK) -L$(C_LIB_DIR) -m -c -s -v @&&| # temp response file, starts with | - $(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency + $(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency $< $*.map $(LIBS) @@ -91,7 +91,7 @@ clean : # Compiler configuration file $(BCC_CFG) : - Copy &&| + Copy &&| $(CFLAGS) -c -y #include line numbers in OBJ's diff --git a/ports/xplained/.clang-format b/ports/xplained/.clang-format new file mode 100644 index 00000000..579a192a --- /dev/null +++ b/ports/xplained/.clang-format @@ -0,0 +1,7 @@ +--- +# Disable formatting for now as there is external code. We should move external +# code to a separate directory and enable formatting for our code. +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/ports/xplained/.editorconfig b/ports/xplained/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/ports/xplained/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/ports/xplained/external/.clang-format b/ports/xplained/external/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/ports/xplained/external/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/src/Makefile b/src/Makefile index e1457886..08c8b35b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,7 +12,7 @@ CFLAGS += -Dbacnet_stack_EXPORTS ifeq ($(STATIC),1) - CFLAGS += -DBACNET_STACK_STATIC_DEFINE + CFLAGS += -DBACNET_STACK_STATIC_DEFINE endif # These might be already defined in an previous Makefile diff --git a/test/Makefile b/test/Makefile index b116dadc..03b942c0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -33,21 +33,21 @@ endif # overwhelm builders with limited resources # set job limits based on number of core processors ifeq (${JOBS},) - ifeq ($(UNAME_S),Windows) - JOBS = "-j %NUMBER_OF_PROCESSORS%" - endif - ifeq ($(UNAME_S),Linux) - JOBS = "-j $(shell nproc)" - endif - ifeq ($(UNAME_S),Darwin) - JOBS = "-j $(sysctl -n hw.ncpu)" - endif - ifeq ($(UNAME_S),BSD) - JOBS = "-j $(sysctl -n hw.ncpu)" - endif - ifeq ($(UNAME_S),MinGW) - JOBS = "-j" - endif + ifeq ($(UNAME_S),Windows) + JOBS = "-j %NUMBER_OF_PROCESSORS%" + endif + ifeq ($(UNAME_S),Linux) + JOBS = "-j $(shell nproc)" + endif + ifeq ($(UNAME_S),Darwin) + JOBS = "-j $(sysctl -n hw.ncpu)" + endif + ifeq ($(UNAME_S),BSD) + JOBS = "-j $(sysctl -n hw.ncpu)" + endif + ifeq ($(UNAME_S),MinGW) + JOBS = "-j" + endif endif .PHONY: test diff --git a/test/ztest/.clang-format b/test/ztest/.clang-format new file mode 100644 index 00000000..617477f5 --- /dev/null +++ b/test/ztest/.clang-format @@ -0,0 +1,5 @@ +--- +DisableFormat: true + +# DisableFormat will not disable include sorting with some versions. +SortIncludes: Never diff --git a/test/ztest/.editorconfig b/test/ztest/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/test/ztest/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/tools/avstack/.editorconfig b/tools/avstack/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/tools/avstack/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/tools/check-stack-usage/.editorconfig b/tools/check-stack-usage/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/tools/check-stack-usage/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/tools/memap/.editorconfig b/tools/memap/.editorconfig new file mode 100644 index 00000000..0fd45c99 --- /dev/null +++ b/tools/memap/.editorconfig @@ -0,0 +1,7 @@ +# External folder so ignore everything. +[*] +charset = unset +insert_final_newline = unset +trim_trailing_whitespace = unset +indent_style = unset +end_of_line = unset diff --git a/zephyr/.clang-format b/zephyr/.clang-format deleted file mode 100644 index f6e943fd..00000000 --- a/zephyr/.clang-format +++ /dev/null @@ -1,145 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# clang-format configuration file. Intended for clang-format >= 4. -# -# 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 -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -#AlignEscapedNewlines: Left # Unknown to clang-format-4.0 -AlignOperands: true -AlignTrailingComments: false -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: None -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false -BinPackArguments: true -BinPackParameters: true -BraceWrapping: - AfterClass: false - AfterControlStatement: false - AfterEnum: false - AfterFunction: true - AfterNamespace: true - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - #AfterExternBlock: false # Unknown to clang-format-5.0 - BeforeCatch: false - BeforeElse: false - IndentBraces: false - #SplitEmptyFunction: true # Unknown to clang-format-4.0 - #SplitEmptyRecord: true # Unknown to clang-format-4.0 - #SplitEmptyNamespace: true # Unknown to clang-format-4.0 -BreakBeforeBinaryOperators: None -BreakBeforeBraces: Custom -#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 -BreakBeforeTernaryOperators: false -BreakConstructorInitializersBeforeComma: false -#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: false -ColumnLimit: 80 -CommentPragmas: '^ IWYU pragma:' -#CompactNamespaces: false # Unknown to clang-format-4.0 -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 8 -ContinuationIndentWidth: 8 -Cpp11BracedListStyle: false -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -#FixNamespaceComments: false # Unknown to clang-format-4.0 - -# Taken from: -# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \ -# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \ -# | sort | uniq -ForEachMacros: - - 'FOR_EACH' - - 'FOR_EACH_FIXED_ARG' - - 'RB_FOR_EACH' - - 'RB_FOR_EACH_CONTAINER' - - 'SYS_DLIST_FOR_EACH_CONTAINER' - - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' - - 'SYS_DLIST_FOR_EACH_NODE' - - 'SYS_DLIST_FOR_EACH_NODE_SAFE' - - 'SYS_SFLIST_FOR_EACH_CONTAINER' - - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' - - 'SYS_SFLIST_FOR_EACH_NODE' - - 'SYS_SFLIST_FOR_EACH_NODE_SAFE' - - 'SYS_SLIST_FOR_EACH_CONTAINER' - - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' - - 'SYS_SLIST_FOR_EACH_NODE' - - 'SYS_SLIST_FOR_EACH_NODE_SAFE' - - 'Z_GENLIST_FOR_EACH_CONTAINER' - - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' - - 'Z_GENLIST_FOR_EACH_NODE' - - 'Z_GENLIST_FOR_EACH_NODE_SAFE' - - '_WAIT_Q_FOR_EACH' - -#IncludeBlocks: Preserve # Unknown to clang-format-5.0 -IncludeCategories: - - Regex: '.*' - Priority: 1 -IncludeIsMainRegex: '(Test)?$' -IndentCaseLabels: false -#IndentPPDirectives: None # Unknown to clang-format-5.0 -IndentWidth: 8 -IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: false -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: Inner -#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 -ObjCBlockIndentWidth: 8 -ObjCSpaceAfterProperty: true -ObjCSpaceBeforeProtocolList: true - -# Taken from git's rules -#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 -PenaltyBreakBeforeFirstCallParameter: 30 -PenaltyBreakComment: 10 -PenaltyBreakFirstLessLess: 0 -PenaltyBreakString: 10 -PenaltyExcessCharacter: 100 -PenaltyReturnTypeOnItsOwnLine: 60 - -PointerAlignment: Right -ReflowComments: false -SortIncludes: false -#SortUsingDeclarations: false # Unknown to clang-format-4.0 -SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: true -SpaceBeforeAssignmentOperators: true -#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 -#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 -SpaceBeforeParens: ControlStatements -#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInContainerLiterals: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Cpp03 -TabWidth: 8 -UseTab: Always -...