[PATCH v5] devtools: add .clang-format file
Stephen Hemminger
stephen at networkplumber.org
Mon Oct 7 19:24:10 CEST 2024
On Thu, 16 May 2024 08:20:51 +0000
Abdullah Ömer Yamaç <aomeryamac at gmail.com> wrote:
> 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ç <aomeryamac at gmail.com>
> ---
> .clang-format | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 149 insertions(+)
> create mode 100644 .clang-format
>
> diff --git a/.clang-format b/.clang-format
> new file mode 100644
> index 0000000000..5f86e1be79
> --- /dev/null
> +++ b/.clang-format
> @@ -0,0 +1,149 @@
> +---
> +BasedOnStyle: LLVM
Looks good but any new file in DPDK needs a SPDX license header.
Not sure why, but it seems to be indenting somethings to much.
Example:
Before clang-format:
static struct rte_vdev_driver pmd_pcap_drv = {
.probe = pmd_pcap_probe,
.remove = pmd_pcap_remove,
};
After clang-format:
static struct rte_vdev_driver pmd_pcap_drv = {
.probe = pmd_pcap_probe,
.remove = pmd_pcap_remove,
};
More information about the dev
mailing list