diff options
author | say <say@yandex-team.com> | 2023-09-28 17:58:30 +0300 |
---|---|---|
committer | say <say@yandex-team.com> | 2023-09-28 18:39:04 +0300 |
commit | e1bf3a3e544c1895f0cbdca317f43740cc8cb6db (patch) | |
tree | 8823a8b17bd9188a08a0c3fcb0f902b0320da38b | |
parent | 1b2cc051281e67c9b930068caaa1df1fc74e3c07 (diff) | |
download | ydb-e1bf3a3e544c1895f0cbdca317f43740cc8cb6db.tar.gz |
Move style configs from devtools to build directory
-rw-r--r-- | build/config/tests/cpp_style/config.clang-format | 88 | ||||
-rw-r--r-- | build/config/tests/cpp_style/ya.make | 7 | ||||
-rw-r--r-- | build/plugins/pybuild.py | 2 | ||||
-rw-r--r-- | library/python/cpp_test/test_cpp.py | 2 | ||||
-rw-r--r-- | library/python/cpp_test/ya.make | 5 |
5 files changed, 98 insertions, 6 deletions
diff --git a/build/config/tests/cpp_style/config.clang-format b/build/config/tests/cpp_style/config.clang-format new file mode 100644 index 0000000000..c4bedb3f4e --- /dev/null +++ b/build/config/tests/cpp_style/config.clang-format @@ -0,0 +1,88 @@ +Language: Cpp +AccessModifierOffset: -4 +ConstructorInitializerIndentWidth: 4 +AlignEscapedNewlinesLeft: false +AlignEscapedNewlines: Left +AlignTrailingComments: true +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 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +SpacesBeforeTrailingComments: 1 +Cpp11BracedListStyle: true +Standard: c++20 +IndentWidth: 4 +TabWidth: 4 +UseTab: Never +BreakBeforeBraces: Attach + +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 + +NamespaceMacros: [Y_UNIT_TEST_SUITE, Y_UNIT_TEST] +SpaceBeforeInheritanceColon: false +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] +SpacesInLineCommentPrefix: + Minimum: 0 + Maximum: -1 diff --git a/build/config/tests/cpp_style/ya.make b/build/config/tests/cpp_style/ya.make new file mode 100644 index 0000000000..bb5fccd5ea --- /dev/null +++ b/build/config/tests/cpp_style/ya.make @@ -0,0 +1,7 @@ +LIBRARY() + +RESOURCE_FILES( + config.clang-format +) + +END() diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index 31683217e6..dfbc21da4f 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -189,7 +189,7 @@ def add_python_lint_checks(unit, py_ver, files): resolved_files = get_resolved_files() if resolved_files: black_cfg = ( - unit.get('STYLE_PYTHON_PYPROJECT_VALUE') or 'devtools/ya/handlers/style/python_style_config.toml' + unit.get('STYLE_PYTHON_PYPROJECT_VALUE') or 'build/config/tests/py_style/config.toml' ) params = ['black', 'tools/black_linter/black_linter'] params += ['FILES'] + resolved_files diff --git a/library/python/cpp_test/test_cpp.py b/library/python/cpp_test/test_cpp.py index 674feb45e9..b7607d66c2 100644 --- a/library/python/cpp_test/test_cpp.py +++ b/library/python/cpp_test/test_cpp.py @@ -10,7 +10,7 @@ from library.python.testing.style import rules import library.python.resource as lpr -STYLE_CONFIG_JSON = json.dumps(yaml.safe_load(lpr.find('/cpp_style/config'))) +STYLE_CONFIG_JSON = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format'))) RES_FILE_PREFIX = '/cpp_style/files/' CHECKED_PATHS = list(lpr.iterkeys(RES_FILE_PREFIX, strip_prefix=True)) diff --git a/library/python/cpp_test/ya.make b/library/python/cpp_test/ya.make index 6267cbf630..9fbc921298 100644 --- a/library/python/cpp_test/ya.make +++ b/library/python/cpp_test/ya.make @@ -1,6 +1,7 @@ PY3_LIBRARY() PEERDIR( + build/config/tests/cpp_style contrib/python/PyYAML library/python/resource library/python/testing/style @@ -11,8 +12,4 @@ TEST_SRCS( test_cpp.py ) -RESOURCE( - devtools/ya/handlers/style/style_config /cpp_style/config -) - END() |