The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] clang-format: Set IndentWrappedFunctionNames false
@ 2018-06-06 20:15 Jason Gunthorpe
  2018-06-06 20:18 ` Joe Perches
  2018-06-07 12:50 ` Miguel Ojeda
  0 siblings, 2 replies; 7+ messages in thread
From: Jason Gunthorpe @ 2018-06-06 20:15 UTC (permalink / raw)
  To: linux-kernel, Miguel Ojeda
  Cc: Randy Dunlap, Andy Whitcroft, Joe Perches, Jonathan Corbet,
	Andrew Morton

The true option causes this indenting for functions:

static struct something_very_very_long *
    function(void *arg)
{

While a quick survey suggests that the usual Linux fallback is the GNU
style:

static struct something_very_very_long *
function(void *arg)
{

Eg as seen in:

 kernel/cpu.c
 kernel/fork.c

and other places.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 .clang-format | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks for making this Miguel!

I've been using clang-format for years with the kernel and noticed it
was performing just a little different than I would have expected.

AFAIK the above describes the more common choice in the code base?

Not sure who's tree this is supposed to go through.. Andrew I guess?

diff --git a/.clang-format b/.clang-format
index faffc0d5af4eeb..1d5da22e0ba50c 100644
--- a/.clang-format
+++ b/.clang-format
@@ -382,7 +382,7 @@ IncludeIsMainRegex: '(Test)?$'
 IndentCaseLabels: false
 #IndentPPDirectives: None # Unknown to clang-format-5.0
 IndentWidth: 8
-IndentWrappedFunctionNames: true
+IndentWrappedFunctionNames: false
 JavaScriptQuotes: Leave
 JavaScriptWrapImports: true
 KeepEmptyLinesAtTheStartOfBlocks: false
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-07 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-06 20:15 [PATCH] clang-format: Set IndentWrappedFunctionNames false Jason Gunthorpe
2018-06-06 20:18 ` Joe Perches
2018-06-06 20:25   ` Jason Gunthorpe
2018-06-06 20:34     ` Joe Perches
2018-06-07 12:56     ` Miguel Ojeda
2018-06-07 12:43   ` Miguel Ojeda
2018-06-07 12:50 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox