diff --git a/.clang-format b/.clang-format index e1a5ddd00..b30567097 100644 --- a/.clang-format +++ b/.clang-format @@ -56,6 +56,7 @@ ConstructorInitializerIndentWidth: 4 FixNamespaceComments: true IndentGotoLabels: false KeepEmptyLinesAtTheStartOfBlocks: true +QualifierAlignment: Right SortUsingDeclarations: true SpaceAfterTemplateKeyword: false StatementMacros: @@ -71,3 +72,4 @@ ObjCBlockIndentWidth: 4 ObjCBreakBeforeNestedBlockParam: false ObjCSpaceBeforeProtocolList: false PenaltyExcessCharacter: 1 +QualifierAlignment: Right diff --git a/code_style.sh b/code_style.sh index 8769ce79c..7bb9e887c 100755 --- a/code_style.sh +++ b/code_style.sh @@ -65,22 +65,6 @@ if ! find_cfiles -exec "${clang_format_exe}" $clang_format_args '{}' '+'; then exitcode=1 fi -# enforce east const -# look for 'const' -# - as the first token in the line -# - or preceded by 'static' -# - or following any of (<,; -# - but not if 'const' is followed by ` override` (const virtual function) -# - but not if 'const' is followed by ` = 0` (const virtual function) -matches="$(find_cfiles -exec perl -ne 'print "west const:",$ARGV,":",$_ if /((?:^|[(<,;]|\bstatic\s+)\s*)\b(const)\b(?!\s+((\w+\s*\[)|(override)|(\=\ 0)))/' '{}' '+')" -if [ -n "$matches" ]; then - echo "$matches" - exitcode=1 -fi -if [ -n "$fix" ]; then - find_cfiles -exec perl -pi -e 's/((?:^|[(<,;]|\bstatic\s+)\s*)\b(const)\b(?!\s+((\w+\s*\[)|(override)|(\=\ 0)))/\1>\2