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 4E06445B3C; Tue, 15 Oct 2024 00:16:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67DC140270; Tue, 15 Oct 2024 00:16:48 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id BA6764026C for ; Tue, 15 Oct 2024 00:16:47 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4311c285bc9so33419155e9.3 for ; Mon, 14 Oct 2024 15:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728944207; x=1729549007; 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=vn9cYqP+R+Hgwp3fa2pSq4nK3uLw9cn8b9zS1oK+bds=; b=CQE2OdHOiBjqWu9uGHNGV19yEGT+cL/bgWfeaWsM8DLmGOmle6NuZPuS1nUeLczVWD yKnl/4hvbsQgox2bGaMLGK8qa1PhtUQ8LrzAc0prjXBbU9II5rW047T3TVoEXmkJW85z QWaxIChlOZVVACrmislvcA+nG6nu1BzGits8xJqOcgsdi+H0XJsWWoWw9OOjM+woGN5e dxgYBXVym2cf94P4pAMLyL1iClib9eO0xuEqS0XYXvITKesOH/oW4rji8G2ZC1b+YH1X GHPc5dzG89LoPl+f7eeVe8eJ/4CCAdv4tUOcUxXrJm3z7vz3y5LmZQtnl6i7wmKtSqOy k4yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728944207; x=1729549007; 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=vn9cYqP+R+Hgwp3fa2pSq4nK3uLw9cn8b9zS1oK+bds=; b=dXad0hdMhiSnryitqb3BSNBXE4HzetCqb0Sf28B6XsRXWXQbR55LUj3DW5zXQcrIv4 9jR1GMwg70wH6bvIOWu8C7zXzNzzv6QdbFhng1qW/Y28mdIL4XcPHwu9ttHEposLKiDk k6npA6FIkFCY2kbSI7MlTuBdeR0MJZ/6OjQEi6S/0KX6NgRtnA6P6vd9m2VSggqniaqk CBVZ5VSHfpgIBt0q6BAhLQkjonXlq64OmdAiUREKX5XxdgN/C64H+zmV/eJmbXM1oNpG 6TiM9KUuNLGU/utLram6rnuSEY2qcyclMvfh9kGtweZ0AObmVdYMTzdtSTsINqwiNTUS HtPw== X-Gm-Message-State: AOJu0Yx2gY38dtPiFDvjHrx1hb783l8wMB1lBfwa4nG1O7f1U9FYTGZ/ Pz6KuRxhLcwcLx0ltqL7ZIh7WeLntG6aGMGa70yprvMECsMPpXvCimcR9w== X-Google-Smtp-Source: AGHT+IHsHGjL2FXaYMdKJGYeg5tM2JeY8p+DJEvawbhOcyRDOZtTXpxLO2b5qxUN6nQkGxfwGRB0Nw== X-Received: by 2002:a05:600c:4e46:b0:42c:b8cc:205a with SMTP id 5b1f17b1804b1-4311df5644amr123982025e9.32.1728944206754; Mon, 14 Oct 2024 15:16:46 -0700 (PDT) Received: from dcu.otaknetworks.com ([212.156.37.190]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4311b69f652sm73618765e9.1.2024.10.14.15.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 15:16:45 -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 v6] devtools: add .clang-format file Date: Mon, 14 Oct 2024 22:16:42 +0000 Message-Id: <20241014221642.66974-1-aomeryamac@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241007102410.6c68f2c6@hermes.local> References: <20241007102410.6c68f2c6@hermes.local> 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 | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..805c08da1d --- /dev/null +++ b/.clang-format @@ -0,0 +1,153 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2024 Abdullah Ömer Yamaç. +# + +--- +BasedOnStyle: LLVM + +# Place opening and closing parentheses on the same line for control statements +BreakBeforeBraces: Custom +BraceWrapping: + AfterFunction: true + AfterControlStatement: false + +AllowShortEnumsOnASingleLine: false + +# Should be declared this way: +SpaceBeforeParens: Custom +SpaceBeforeParensOptions: + AfterForeachMacros: 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 16 spaces (2 tabs) +AlignAfterOpenBracket: DontAlign +ContinuationIndentWidth: 16 + +# 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", + ] +ObjCSpaceAfterProperty: true +IndentGotoLabels: false -- 2.34.1