From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7664143F7D; Sat, 4 May 2024 21:18:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F380D402D5; Sat, 4 May 2024 21:18:42 +0200 (CEST) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mails.dpdk.org (Postfix) with ESMTP id DD3594014F for ; Sat, 4 May 2024 21:18:41 +0200 (CEST) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a599af16934so147026066b.1 for ; Sat, 04 May 2024 12:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714850321; x=1715455121; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QwalMdcdpYLz4b5LwTYZ77CeoLfG0jP1UCg47TUVxko=; b=OxloUqNmM/nZv/kI8P44gb8TV26i9OUzXYOKl7+foHhJABJ3o/JvctqdPY8oSZmFKK PbYG4Lt1z0mqfhE/rMHpfpWJ0rRzFKDcbHaXz05KFWiz3Cdur/1uva02GLp1dtQaHN54 +JjWlPAG5yiUhY2xLYAHlP3Uevibb80CNkOi9f3ijfvHzC2ykkdPsPFD7cQfGfWQTJ9p adC3SCGGD6IlIlQR5f2MwPxAOenh+odVODScufCl4ihdBXaiekpV9+vKOCRbAlGOZYZY XWmSQ5fJO58Yc8BoTBfeijygN+I3hiGLMSevcxDXDp78y2Lsk+o1qKo+q5m9sAS7RrcH o5LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714850321; x=1715455121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QwalMdcdpYLz4b5LwTYZ77CeoLfG0jP1UCg47TUVxko=; b=sb0utLqMCOBHIBnUvdg7pHHpcvaS52ZJGcRxr3+BVcoywv/2F40HBvPygH+bN1pQmM RCmxZI8HI2jXrbnmYsHyk55oRELWV5GQjmyiOp/kp+jT2K5Hssh3M8AGTCcPz2Df2awh GDqRlv2JbyNZLNB4jucyI9LyDSliwE15NV5EUTiNcNOUaFLYraH89OSltPGSGdiKlcIV zUCU0YEiamBgxXda4zkD5ZW1HWDuw/n6EyAmwFgghUk+Ook1jxLiI9cHjfU4MOXGNCMp 54lOWvkFCAibk/K4zJd6f+Xjhjk00X5XqHzDpfXC8/APd+Qmo11gUNxH1J9trsc2/YUa CcCg== X-Gm-Message-State: AOJu0YzJI8hA5NbaPgt0qDswDrlWeTnJA7xn/OFdelgnyEqRsEhsyCB8 X6wv1p5MkeyWjZlW8+wdPjEAN2V1BxD42d80Lp/kwWj6cqVFf2VX/lzlKw== X-Google-Smtp-Source: AGHT+IHgFtKuR0lno3421l2lKUgr/RqO9g+K7RlJVNQifVUp/pRGz1qIEUn0gZqHVXitzC6C+xDeoQ== X-Received: by 2002:a17:906:40ca:b0:a51:e05f:2455 with SMTP id a10-20020a17090640ca00b00a51e05f2455mr4266712ejk.48.1714850320919; Sat, 04 May 2024 12:18:40 -0700 (PDT) Received: from dcu.otaknetworks.com ([212.156.37.190]) by smtp.gmail.com with ESMTPSA id c17-20020a1709060fd100b00a526a992d82sm3195708ejk.4.2024.05.04.12.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 12:18:40 -0700 (PDT) From: =?UTF-8?q?Abdullah=20=C3=96mer=20Yama=C3=A7?= To: dev@dpdk.org Cc: =?UTF-8?q?Abdullah=20=C3=96mer=20Yama=C3=A7?= Subject: [PATCH v3] devtools: add .clang-format file Date: Sat, 4 May 2024 19:18:37 +0000 Message-Id: <20240504191837.1096185-1-aomeryamac@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org clang-format is a tool to format C/C++/Objective-C code. It can be used to reformat code to match a given coding style, or to ensure that code adheres to a specific coding style. It helps to maintain a consistent coding style across the DPDK codebase. .clang-format file overrides the default style options provided by clang-format and large set of IDEs and text editors support it. Signed-off-by: Abdullah Ömer Yamaç --- .clang-format | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..16164ef1de --- /dev/null +++ b/.clang-format @@ -0,0 +1,138 @@ +--- +BasedOnStyle: LLVM + +# Place opening and closing parentheses on the same line for control statements +BreakBeforeBraces: Custom +BraceWrapping: + AfterFunction: false + AfterControlStatement: false + AfterEnum: false + +# Set maximum line length to 100 characters +ColumnLimit: 100 + +# Use LF (line feed) as the end-of-line character +LineEnding: LF + +# Insert a newline at the end of the file +InsertNewlineAtEOF: true + +# Set indentation width to 8 spaces +IndentWidth: 8 + +# Set continuation indentation width to 8 spaces +ContinuationIndentWidth: 8 + +# Set tab width to 8 spaces +TabWidth: 8 + +# Use tabs for indentation +UseTab: Always + +# Preserve include blocks as they are +IncludeBlocks: Preserve + +# Never sort includes +SortIncludes: Never + +# Always break after return type for top-level definitions +AlwaysBreakAfterReturnType: TopLevelDefinitions + +# Always break before multiline string literals +AlignEscapedNewlines: Left + +# Foreach macros +ForEachMacros: [ + "CIRBUF_FOREACH", + "DLB2_LIST_FOR_EACH", + "DLB2_LIST_FOR_EACH_SAFE", + "ECORE_LIST_FOR_EACH_ENTRY", + "ECORE_LIST_FOR_EACH_ENTRY_SAFE", + "FOR_EACH", + "FOR_EACH_BUCKET", + "FOR_EACH_CNIC_QUEUE", + "FOR_EACH_COS_IN_TX_QUEUE", + "FOR_EACH_ETH_QUEUE", + "FOR_EACH_MEMBER", + "FOR_EACH_NONDEFAULT_ETH_QUEUE", + "FOR_EACH_NONDEFAULT_QUEUE", + "FOR_EACH_PORT", + "FOR_EACH_PORT_IF", + "FOR_EACH_QUEUE", + "FOR_EACH_SUITE_TESTCASE", + "FOR_EACH_SUITE_TESTSUITE", + "FOREACH_ABS_FUNC_IN_PORT", + "FOREACH_DEVICE_ON_AUXILIARY_BUS", + "FOREACH_DEVICE_ON_CDXBUS", + "FOREACH_DEVICE_ON_PCIBUS", + "FOREACH_DEVICE_ON_PLATFORM_BUS", + "FOREACH_DEVICE_ON_UACCEBUS", + "FOREACH_DEVICE_ON_VMBUS", + "FOREACH_DRIVER_ON_AUXILIARY_BUS", + "FOREACH_DRIVER_ON_CDXBUS", + "FOREACH_DRIVER_ON_PCIBUS", + "FOREACH_DRIVER_ON_PLATFORM_BUS", + "FOREACH_DRIVER_ON_UACCEBUS", + "FOREACH_DRIVER_ON_VMBUS", + "FOREACH_SUBDEV", + "FOREACH_SUBDEV_STATE", + "HLIST_FOR_EACH_ENTRY", + "ILIST_FOREACH", + "LIST_FOR_EACH_ENTRY", + "LIST_FOR_EACH_ENTRY_SAFE", + "LIST_FOREACH", + "LIST_FOREACH_FROM", + "LIST_FOREACH_FROM_SAFE", + "LIST_FOREACH_SAFE", + "ML_AVG_FOREACH_QP", + "ML_AVG_FOREACH_QP_MVTVM", + "ML_AVG_RESET_FOREACH_QP", + "ML_MAX_FOREACH_QP", + "ML_MAX_FOREACH_QP_MVTVM", + "ML_MAX_RESET_FOREACH_QP", + "ML_MIN_FOREACH_QP", + "ML_MIN_FOREACH_QP_MVTVM", + "ML_MIN_RESET_FOREACH_QP", + "MLX5_ETH_FOREACH_DEV", + "MLX5_IPOOL_FOREACH", + "MLX5_L3T_FOREACH", + "OSAL_LIST_FOR_EACH_ENTRY", + "OSAL_LIST_FOR_EACH_ENTRY_SAFE", + "PLT_TAILQ_FOREACH_SAFE", + "RTE_BBDEV_FOREACH", + "RTE_DEV_FOREACH", + "RTE_DMA_FOREACH_DEV", + "RTE_EAL_DEVARGS_FOREACH", + "RTE_ETH_FOREACH_DEV", + "RTE_ETH_FOREACH_DEV_OF", + "RTE_ETH_FOREACH_DEV_OWNED_BY", + "RTE_ETH_FOREACH_DEV_SIBLING", + "RTE_ETH_FOREACH_MATCHING_DEV", + "RTE_ETH_FOREACH_VALID_DEV", + "RTE_GPU_FOREACH", + "RTE_GPU_FOREACH_CHILD", + "RTE_GPU_FOREACH_PARENT", + "RTE_LCORE_FOREACH", + "RTE_LCORE_FOREACH_WORKER", + "RTE_TAILQ_FOREACH", + "RTE_TAILQ_FOREACH_SAFE", + "SILIST_FOREACH", + "SLIST_FOREACH", + "SLIST_FOREACH_FROM", + "SLIST_FOREACH_FROM_SAFE", + "SLIST_FOREACH_PREVPTR", + "SLIST_FOREACH_SAFE", + "STAILQ_FOREACH", + "STAILQ_FOREACH_FROM", + "STAILQ_FOREACH_FROM_SAFE", + "STAILQ_FOREACH_SAFE", + "TAILQ_FOREACH", + "TAILQ_FOREACH_ENTRY", + "TAILQ_FOREACH_ENTRY_SAFE", + "TAILQ_FOREACH_FROM", + "TAILQ_FOREACH_FROM_SAFE", + "TAILQ_FOREACH_REVERSE", + "TAILQ_FOREACH_REVERSE_FROM", + "TAILQ_FOREACH_REVERSE_FROM_SAFE", + "TAILQ_FOREACH_REVERSE_SAFE", + "TAILQ_FOREACH_SAFE", ] -- 2.34.1