<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 15, 2024 at 6:07 PM Stephen Hemminger <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 15 May 2024 09:43:22 +0100<br>
Bruce Richardson <<a href="mailto:bruce.richardson@intel.com" target="_blank">bruce.richardson@intel.com</a>> wrote:<br>
<br>
> On Wed, May 15, 2024 at 11:28:33AM +0300, Abdullah Ömer Yamaç wrote:<br>
> > I want to update you.<br>
> > On Mon, May 13, 2024 at 4:08 PM Ferruh Yigit <[1]<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a>><br>
> > wrote:<br>
> > <br>
> > On 5/8/2024 10:19 PM, Abdullah Ömer Yamaç wrote: <br>
> > > clang-format is a tool to format C/C++/Objective-C code. It can be <br>
> > used <br>
> > > to reformat code to match a given coding style, or to ensure that <br>
> > code <br>
> > > adheres to a specific coding style. It helps to maintain a <br>
> > consistent <br>
> > > coding style across the DPDK codebase.<br>
> > ><br>
> > > .clang-format file overrides the default style options provided by<br>
> > > clang-format and large set of IDEs and text editors support it.<br>
> > ><br>
> > > Signed-off-by: Abdullah Ömer Yamaç <[2]<a href="mailto:aomeryamac@gmail.com" target="_blank">aomeryamac@gmail.com</a>><br>
> > > <br>
> > Hi Omer,<br>
> > I tried on ethdev.c (clang-format -i ./lib/ethdev/rte_ethdev.c), I<br>
> > will<br>
> > highlight a few issues below (not all of them), I hope it is OK to<br>
> > continue step by step, fixing these issues.<br>
> > 1. clang format failed for following options, not sure why, am I<br>
> > using a<br>
> > wrong version:<br>
> > LineEnding: LF<br>
> > InsertNewlineAtEOF: true<br>
> > I commented them out to continue the test.<br>
> > And for 'ColumnLimit', I prefer default 80 with the flexibility to<br>
> > go<br>
> > 100 when makes sense, so I will got with 'ColumnLimit: 80'; but I<br>
> > don't<br>
> > want to start this discussion.<br>
> > <br>
> > In the .editorconfig file, 100 is stated as a max_line_length. That's<br>
> > why I prefer 100.<br>
> > <br>
> <br>
> +1 for keeping as 100<br>
> <br>
> > 2. Double tab indentation vs parenthesis align<br>
> > if (iter->bus != NULL &&<br>
> > - /* not in middle of rte_eth_dev iteration,<br>
> > */<br>
> > - iter->class_device == NULL) {<br>
> > + /* not in middle of rte_eth_dev iteration, */<br>
> > + iter->class_device == NULL) {<br>
> > DPDK coding guide suggests double tab, but also accepts alignment by<br>
> > spaces. But as far as I can see most of code has double tab.<br>
> > Majority of the diff caused because of this rule.<br>
> > <br>
> > Still, some discussions are going on<br>
> > <br>
> <br>
> This is one where I don't think we will were reach a consensus, and even if<br>
> we did, it would mean massive churn to DPDK. Can we have clang-format NOT<br>
> adjust line-continuations in a file?<br>
<br>
<br>
Clang format is useful on new and seriously broken code.<br>
Do not want to do it automatically or accept patches across all the current code.<br>
<br>
For indentation, can we get some setting that matches what DPDK double tab does?<br></blockquote><div>It seems possible. If there is no objection, I will send a new patch with the previous notes Ferruh stated. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If not is there something close. Often useful to look at the other clang format<br>
pre-set styles in source.<br>
</blockquote></div></div>