diff --git a/components/core/.clang-format b/components/core/.clang-format index c282164b8..ff65adbae 100644 --- a/components/core/.clang-format +++ b/components/core/.clang-format @@ -1,75 +1,5 @@ -# yamllint disable-line rule:document-start ---- -ColumnLimit: 100 -IndentWidth: 4 -# yamllint disable-line rule:document-start ---- -Language: "Cpp" -AccessModifierOffset: -4 -AlignAfterOpenBracket: "BlockIndent" -AlignArrayOfStructures: "None" -AlignConsecutiveAssignments: "None" -AlignConsecutiveBitFields: "None" -AlignConsecutiveDeclarations: "None" -AlignConsecutiveMacros: "None" -AlignEscapedNewlines: "DontAlign" -AlignOperands: "Align" -AlignTrailingComments: - Kind: "Never" -AllowAllArgumentsOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false -AllowBreakBeforeNoexceptSpecifier: "OnlyWithParen" -AllowShortBlocksOnASingleLine: "Always" -AllowShortCaseLabelsOnASingleLine: false -AllowShortCompoundRequirementOnASingleLine: true -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: "Inline" -AllowShortIfStatementsOnASingleLine: "Never" -AllowShortLambdasOnASingleLine: "All" -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: "None" -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: "Yes" -BinPackArguments: false -BinPackParameters: false -BitFieldColonSpacing: "Both" -BraceWrapping: - AfterCaseLabel: false - AfterClass: false - AfterControlStatement: "MultiLine" - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterExternBlock: false - AfterStruct: false - AfterUnion: false - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: false - SplitEmptyNamespace: false - SplitEmptyRecord: false -BreakAfterAttributes: "Never" -BreakBeforeBinaryOperators: "All" -BreakBeforeBraces: "Custom" -BreakBeforeConceptDeclarations: "Always" -BreakBeforeInlineASMColon: "OnlyMultiline" -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: "BeforeColon" -BreakInheritanceList: "BeforeColon" -BreakStringLiterals: true -CompactNamespaces: true -ConstructorInitializerIndentWidth: 8 -ContinuationIndentWidth: 8 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -EmptyLineAfterAccessModifier: "Never" -EmptyLineBeforeAccessModifier: "LogicalBlock" -FixNamespaceComments: true -IncludeBlocks: "Regroup" +BasedOnStyle: "InheritParentConfig" + IncludeCategories: # NOTE: A header is grouped by first matching regex # Library headers. Update when adding new libraries. @@ -86,80 +16,3 @@ IncludeCategories: # Project headers - Regex: "^\".+\"" Priority: 4 -IndentAccessModifiers: false -IndentCaseBlocks: false -IndentCaseLabels: true -IndentExternBlock: "Indent" -IndentGotoLabels: false -IndentPPDirectives: "BeforeHash" -IndentRequiresClause: false -IndentWrappedFunctionNames: false -InsertBraces: true -InsertNewlineAtEOF: true -IntegerLiteralSeparator: - Binary: 4 - BinaryMinDigits: 4 - Decimal: 3 - DecimalMinDigits: 5 - Hex: 4 - HexMinDigits: 4 -KeepEmptyLinesAtTheStartOfBlocks: false -LambdaBodyIndentation: "Signature" -LineEnding: "LF" -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: "None" -PPIndentWidth: -1 -PackConstructorInitializers: "CurrentLine" -PenaltyBreakOpenParenthesis: 25 -PenaltyBreakBeforeFirstCallParameter: 25 -PenaltyReturnTypeOnItsOwnLine: 100 -PointerAlignment: "Left" -QualifierAlignment: "Custom" -QualifierOrder: - - "static" - - "friend" - - "inline" - # constexpr west as explained in https://www.youtube.com/watch?v=z6s6bacI424 - - "constexpr" - - "type" - - "const" - - "volatile" -ReferenceAlignment: "Pointer" -ReflowComments: true -RemoveBracesLLVM: false -RemoveSemicolon: true -RequiresClausePosition: "OwnLine" -RequiresExpressionIndentation: "OuterScope" -SeparateDefinitionBlocks: "Always" -ShortNamespaceLines: 0 -SortIncludes: "CaseInsensitive" -SortUsingDeclarations: "Lexicographic" -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: true -SpaceAroundPointerQualifiers: "Default" -SpaceBeforeAssignmentOperators: true -SpaceBeforeCaseColon: false -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: "ControlStatements" -SpaceBeforeRangeBasedForLoopColon: true -SpaceBeforeSquareBrackets: false -SpaceInEmptyBlock: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInContainerLiterals: false -SpacesInLineCommentPrefix: - Minimum: 1 - Maximum: -1 -SpacesInParens: "Custom" -SpacesInParensOptions: - InConditionalStatements: false - InCStyleCasts: false - InEmptyParentheses: false - Other: false -SpacesInSquareBrackets: false -Standard: "Latest" -TabWidth: 4 -UseTab: "Never" diff --git a/lint-tasks.yml b/lint-tasks.yml index a3c86cc80..d1da57771 100644 --- a/lint-tasks.yml +++ b/lint-tasks.yml @@ -21,6 +21,8 @@ tasks: cpp-check: sources: &cpp_source_files + - "{{.ROOT_DIR}}/.clang-format" + - "{{.ROOT_DIR}}/.clang-tidy" - "{{.TASKFILE}}" - ".clang-format" - "src/**/*.cpp" @@ -119,7 +121,7 @@ tasks: requires: vars: ["FLAGS"] dir: "components/core" - deps: ["venv"] + deps: ["cpp-lint-configs", "venv"] cmds: - |- . "{{.G_LINT_VENV_DIR}}/bin/activate" @@ -129,6 +131,10 @@ tasks: -print0 | \ xargs -0 clang-format {{.FLAGS}} -Werror + cpp-lint-configs: + internal: true + cmd: "{{.ROOT_DIR}}/tools/yscope-dev-utils/lint-configs/symlink-cpp-lint-configs.sh" + js: internal: true requires: diff --git a/tools/scripts/deps-download/init.sh b/tools/scripts/deps-download/init.sh index 57fcd4594..fa626cc82 100755 --- a/tools/scripts/deps-download/init.sh +++ b/tools/scripts/deps-download/init.sh @@ -11,7 +11,7 @@ project_root_dir="$script_dir/../../../" download_dep_script="$script_dir/download-dep.py" python3 "${download_dep_script}" \ - https://github.com/y-scope/yscope-dev-utils/archive/ff1611e6.zip \ - yscope-dev-utils-ff1611e6f9b116da27dc7f8f71797829c22d0b1a \ + https://github.com/y-scope/yscope-dev-utils/archive/2caa3dcf.zip \ + yscope-dev-utils-2caa3dcfbbccff052d179e643a509d8ad05bc217 \ "${project_root_dir}/tools/yscope-dev-utils" \ --extract diff --git a/tools/yscope-dev-utils b/tools/yscope-dev-utils index ff1611e6f..2caa3dcfb 160000 --- a/tools/yscope-dev-utils +++ b/tools/yscope-dev-utils @@ -1 +1 @@ -Subproject commit ff1611e6f9b116da27dc7f8f71797829c22d0b1a +Subproject commit 2caa3dcfbbccff052d179e643a509d8ad05bc217