From 6e66aaa3ff0b341f50ac8d12e3cb98f19efe9dd7 Mon Sep 17 00:00:00 2001 From: alevitskii Date: Mon, 24 Feb 2025 13:09:09 +0300 Subject: Rename default clang-format/black linter configs to conventional names Rename default clang-format/black linter configs to conventional names commit_hash:53a5ce4592e4726f0f82f7b2a483864e1500b306 --- build/config/tests/cpp_style/.clang-format | 97 +++++++++++++++++++++++ build/config/tests/cpp_style/default_configs.json | 2 +- build/config/tests/cpp_style/ya.make | 1 + build/config/tests/py_style/default_configs.json | 2 +- build/config/tests/py_style/pyproject.toml | 3 + build/config/tests/py_style/ya.make | 1 + 6 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 build/config/tests/cpp_style/.clang-format create mode 100644 build/config/tests/py_style/pyproject.toml diff --git a/build/config/tests/cpp_style/.clang-format b/build/config/tests/cpp_style/.clang-format new file mode 100644 index 00000000000..b2d89e2e756 --- /dev/null +++ b/build/config/tests/cpp_style/.clang-format @@ -0,0 +1,97 @@ +Language: Cpp +AccessModifierOffset: -4 +ConstructorInitializerIndentWidth: 4 +AlignEscapedNewlinesLeft: false +AlignEscapedNewlines: Left +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AlwaysBreakTemplateDeclarations: true +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: true +BinPackParameters: true +ColumnLimit: 0 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +DerivePointerAlignment: false +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: true +IndentWrappedFunctionNames: false +IndentFunctionDeclarationAfterType: false +MaxEmptyLinesToKeep: 1 +KeepEmptyLinesAtTheStartOfBlocks: false +NamespaceIndentation: All +FixNamespaceComments: true +ShortNamespaceLines: 0 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: Never +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +SpacesBeforeTrailingComments: 1 +SpacesInSquareBrackets: false +Cpp11BracedListStyle: true +Standard: c++20 +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +BreakBeforeBraces: Attach +InsertBraces: true + +# NB: BraceWrapping has no effect unless BreakBeforeBraces is set to Custom +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: true + +SpacesInParentheses: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +CommentPragmas: '^ IWYU pragma:' +ForEachMacros: [ + foreach, + Q_FOREACH, + BOOST_FOREACH, + # Is not a foreach, but correct formatting is achieved + Y_DEFER +] +IfMacros: [ + with_lock # Is not an if, but correct formatting is achieved +] +SpaceBeforeParens: ControlStatements +DisableFormat: false +SortIncludes: false +IndentPPDirectives: BeforeHash + +SpaceBeforeInheritanceColon: false +NamespaceMacros: [Y_UNIT_TEST_SUITE] +AttributeMacros: [Y_PRINTF_FORMAT, Y_NO_SANITIZE, Y_FORCE_INLINE, Y_NO_INLINE, Y_WARN_UNUSED_RESULT, Y_HIDDEN, Y_PUBLIC, Y_PURE_FUNCTION] +IndentExternBlock: Indent +TypenameMacros: [Y_THREAD, Y_STATIC_THREAD, Y_POD_THREAD, Y_POD_STATIC_THREAD] +StatementAttributeLikeMacros: [ythrow] +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: 1 diff --git a/build/config/tests/cpp_style/default_configs.json b/build/config/tests/cpp_style/default_configs.json index f8749d1a012..ae059dbb06a 100644 --- a/build/config/tests/cpp_style/default_configs.json +++ b/build/config/tests/cpp_style/default_configs.json @@ -1,3 +1,3 @@ { - "clang_format": "build/config/tests/cpp_style/config.clang-format" + "clang_format": "build/config/tests/cpp_style/.clang-format" } diff --git a/build/config/tests/cpp_style/ya.make b/build/config/tests/cpp_style/ya.make index bb5fccd5ea4..f2cd71a2685 100644 --- a/build/config/tests/cpp_style/ya.make +++ b/build/config/tests/cpp_style/ya.make @@ -1,6 +1,7 @@ LIBRARY() RESOURCE_FILES( + .clang-format config.clang-format ) diff --git a/build/config/tests/py_style/default_configs.json b/build/config/tests/py_style/default_configs.json index fe67053022b..f742d821b69 100644 --- a/build/config/tests/py_style/default_configs.json +++ b/build/config/tests/py_style/default_configs.json @@ -1,5 +1,5 @@ { - "black": "build/config/tests/py_style/config.toml", + "black": "build/config/tests/py_style/pyproject.toml", "dummy_linter": "build/config/tests/py_style/dummy_linter_config.json", "flake8": "build/config/tests/flake8/flake8.conf", "py2_flake8": "build/config/tests/flake8/flake8.conf", diff --git a/build/config/tests/py_style/pyproject.toml b/build/config/tests/py_style/pyproject.toml new file mode 100644 index 00000000000..6ae249d042e --- /dev/null +++ b/build/config/tests/py_style/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 120 +skip-string-normalization = true diff --git a/build/config/tests/py_style/ya.make b/build/config/tests/py_style/ya.make index 6a6a2875588..95dab982995 100644 --- a/build/config/tests/py_style/ya.make +++ b/build/config/tests/py_style/ya.make @@ -2,6 +2,7 @@ LIBRARY() RESOURCE_FILES( config.toml + pyproject.toml ) END() -- cgit v1.3