From patchwork Mon Jul 11 11:37:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12913411 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F152FC43334 for ; Mon, 11 Jul 2022 11:43:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230373AbiGKLnS (ORCPT ); Mon, 11 Jul 2022 07:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbiGKLmx (ORCPT ); Mon, 11 Jul 2022 07:42:53 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86697F0B for ; Mon, 11 Jul 2022 04:37:40 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id r129-20020a1c4487000000b003a2d053adcbso4817985wma.4 for ; Mon, 11 Jul 2022 04:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7UtlV98ccYnhuaBSt+reyH4IFRW5Xu49/TCCsGTgrRY=; b=Lsept8lUXTUBqhEJaWxT9olx6nIrKp8UR6aqk/mHUpa9VJ9hHnwqiVYctCbThq010G l+vx6CzHVLw7m0rQ0VsDGLXwQEWo15MAUcQeOyoQqXQCumB1fO1Dg9OcXyRPh2oCTaHW rBGzaCVbfqYbVavb3zK4mV7qmO5DJVSyjjPP0LcVBK7ZQcSFxPGryY2Jb0Pr89ynfHkr rqP77z4clnCOUSlaMIQGCDgTrcPH1SQGhMhG++fHU1daHxm4YMj0ZjH3l46lLOr7L/0E 6fYWxnrZu+K76wJNbu7EV4tmYqTMHvxcihYrue3ZQiwm3eL0aMe14mIzdv/R/tstCQH+ /ZSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7UtlV98ccYnhuaBSt+reyH4IFRW5Xu49/TCCsGTgrRY=; b=L+vdX4exJb+TkyvDZN9NHXs4YE4F3Pw5Iw/CXOnyWMEah41N0P7h1Cx9IQAtVibncv 5ZcmWUR+2BmLiLx9ox2YNDO6IWUQD3nIxrNgdf4WOSqaO+sUm+GEnGflpJNM42YNsjHL xdG5UvWZ6BowMHDNkJalKIA9TSabMw6RMucr6lnOLGLPxOVkff8HCoe8BwPxunr+cXX3 APaYcKtCJc/Cuqezyatsq+1yN4Um3/I9v9wWppvz0v0+9YzQaRZFg48kik6BV3jF7yqG FeGPQVZpex0zUQJ3PTLIOC5ainOvdJlpLPeFmc85gH9hCCJUjl791AV+QSICxHFMZZJn A/Lw== X-Gm-Message-State: AJIora8yBt24rYODHa8bExga+t/96nJYaXRdx/9wiOugjljtfN5fdtWE 8pF2P6gpVyRbTWxyWB6JYYRaOUw1lgg= X-Google-Smtp-Source: AGRyM1vc95WVjdMA3J2w4ObnlUbTEmJsB85OXPoceBvUhHfgjO/xNqvYrbRFZLQGaBRCOgn8Rp6iMg== X-Received: by 2002:a05:600c:19d2:b0:3a2:b7c1:861c with SMTP id u18-20020a05600c19d200b003a2b7c1861cmr15500888wmq.37.1657539458641; Mon, 11 Jul 2022 04:37:38 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5562463wrr.39.2022.07.11.04.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 04:37:37 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: "brian m . carlson" , Junio C Hamano , rsbecker@nexbridge.com, =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH 1/4] Makefile: add a style-all targets for .clang-format testing Date: Mon, 11 Jul 2022 13:37:25 +0200 Message-Id: X-Mailer: git-send-email 2.37.0.913.g189dca38629 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Extend "style" rule added in 2118805b929 (Makefile: add style build rule, 2017-08-14) with a set of "style-all" rules. These rules all apply our ".clang-format" added in 6134de6ac18 (clang-format: outline the git project's coding style, 2017-08-14) to all our tracked files, rather than using "git-clang-format", which only applies the rules to files that differ from those that are tracked. This allows for testing and improving the .clang-format itself, as it should as closely as possible mirror out stated Documentation/CodingGuidelines, or in cases where we don't have explicit guidelines it should match the prevailing preferred style in the project. Let's apply one such change, in 6134de6ac18 the "AlignEscapedNewlines" configuration was set to "Left", but as setting it to "DontAlign" shows our more common pattern is to not align "\"'s across newlines in macro definitions. Before & after the .clang-format change, running: git checkout -f '*.[ch]' && make -k style-all-diff-ok -k; make style-all-diff-apply Will yield, respectively: 578 files changed, 32191 insertions(+), 29944 deletions(-) 579 files changed, 32065 insertions(+), 29818 deletions(-) Signed-off-by: Ævar Arnfjörð Bjarmason --- .clang-format | 8 +++--- Makefile | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index c592dda681f..3f536c49f24 100644 --- a/.clang-format +++ b/.clang-format @@ -32,12 +32,12 @@ AlignConsecutiveAssignments: false # double b = 3.14; AlignConsecutiveDeclarations: false -# Align escaped newlines as far left as possible -# #define A \ +# Do not align escaped newlines in macro definitions +# #define A \ # int aaaa; \ -# int b; \ +# int b; \ # int cccccccc; -AlignEscapedNewlines: Left +AlignEscapedNewlines: DontAlign # Align operands of binary and ternary expressions # int aaa = bbbbbbbbbbb + diff --git a/Makefile b/Makefile index 04d0fd1fe60..67306820002 100644 --- a/Makefile +++ b/Makefile @@ -3108,10 +3108,77 @@ $(HCO): %.hco: %.hcc FORCE .PHONY: hdr-check $(HCO) hdr-check: $(HCO) +## +## clang-format targets +## + +### style: apply a clang-format "diff" based on the changes in the +### working tree .PHONY: style style: git clang-format --style file --diff --extensions c,h +#### style: common variables +STYLE_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES) $(EXCEPT_HDRS),\ + $(FOUND_C_SOURCES) $(FOUND_H_SOURCES)) + +#### style-all: generate clang-format output for everything. Copying +#### the file to */in/* is so we can apply it with "git apply" (so one +#### side won't have a .build/style-all/* prefix). If only "git apply" +#### had a "-p" that applied only to one of "a/" or "b/" ... +STYLE_SOURCES_IN = $(addprefix .build/style-all/in/,$(STYLE_SOURCES)) +$(STYLE_SOURCES_IN): .build/style-all/in/% : % + $(call mkdir_p_parent_template) + $(QUIET_LNCP)cp $< $@ + +STYLE_SOURCES_OUT = $(addprefix .build/style-all/out/,$(STYLE_SOURCES)) +$(STYLE_SOURCES_OUT): .clang-format +$(STYLE_SOURCES_OUT): .build/style-all/out/%: .build/style-all/in/% + $(call mkdir_p_parent_template) + $(QUIET_GEN)clang-format $< >$@ +.PHONY: style-all +style-all: $(STYLE_SOURCES_GEN) + +#### style-all-diff: generate diffs of clang-format output +#### v.s. checked-in files +STYLE_SOURCES_DIFF = $(addprefix .build/style-all/diff/,$(STYLE_SOURCES)) +$(STYLE_SOURCES_DIFF): .build/style-all/diff/%: .build/style-all/out/% + $(call mkdir_p_parent_template) + $(QUIET_GEN)git \ + -P \ + diff --no-index \ + $(<:.build/style-all/out/%=.build/style-all/in/%) $< >$@ || \ + test -s $@ + +.PHONY: style-all-diff +style-all-diff: $(STYLE_SOURCES_DIFF) + +#### style-all-diff-ok: fail on files that have pending clang-format +#### changes +STYLE_SOURCES_DIFF_OK = $(addsuffix .ok,$(STYLE_SOURCES_DIFF)) +$(STYLE_SOURCES_DIFF_OK): %.ok: % + $(QUIET_GEN)! test -s $< && \ + >$@ +.PHONY: style-all-diff-ok +style-all-diff-ok: $(STYLE_SOURCES_DIFF_OK) + +.build/style-all.diff: $(STYLE_SOURCES_DIFF) + $(QUIET_GEN)cat $^ >$@ + +#### style-all-diff-apply: apply the proposed clang-format changes. We +#### need to have no local changes here, and use FORCE as the +#### dependency graph of this rule is circular. I.e. we'll modify +#### git.c, but eventually depend on it as well. +STYLE_ALL_DIFF_APPLY_EXCLUDE = +STYLE_ALL_DIFF_APPLY_EXCLUDE += ':!/Makefile' +STYLE_ALL_DIFF_APPLY_EXCLUDE += ':!/.clang-format' +style-all-diff-apply: FORCE +style-all-diff-apply: .build/style-all.diff + git diff --quiet HEAD -- $(STYLE_ALL_DIFF_APPLY_EXCLUDE) && \ + git diff --quiet --cached -- $(STYLE_ALL_DIFF_APPLY_EXCLUDE) && \ + git apply -p4 $< && \ + git -P diff --shortstat -- $(STYLE_ALL_DIFF_APPLY_EXCLUDE) + .PHONY: check check: $(GENERATED_H) @if sparse; \ From patchwork Mon Jul 11 11:37:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12913410 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE434C433EF for ; Mon, 11 Jul 2022 11:43:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiGKLnQ (ORCPT ); Mon, 11 Jul 2022 07:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbiGKLmx (ORCPT ); Mon, 11 Jul 2022 07:42:53 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10A27F20 for ; Mon, 11 Jul 2022 04:37:42 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id z23-20020a7bc7d7000000b003a2e00222acso1684362wmk.0 for ; Mon, 11 Jul 2022 04:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HVb5KZOcIQ0eUZwjdnTaXox4lZXWwuAVKutP2mZTYes=; b=DFStYf+gFzS7Ip2r7PTH2Qwog0MmW3Jxtw7K+TCXm8MEz+8PQqYJ3mN8Y1OOLMn0zV IRzIaYUyd55BRn6Vsko7oyd5auOKfAL885MwZd7o6a8NjIufVyPvPguxmQRAZn49SG5A u7P9dVyYmwGwXTDngHnt4nYGhI1MpklVgDNjM5ObvprpvJfoQWSjMdn0skerkzE3zLvJ 3WTBRH5wgWwaskYOq6aXSy16q2jH7yd0RWPuKFZDn8PqW6AaVY6RtWFo8orIePU8KWOm 8BnH7GgeJ1/K9mo+zfFYA2o9gsw7NjLOnih6T9w3RJk85kpVk2F9gxrpXWDYAtTWNmNF JxOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HVb5KZOcIQ0eUZwjdnTaXox4lZXWwuAVKutP2mZTYes=; b=8GuxYgnumxDrJdmyMYOoGA26mL6k2ytRWns8vpM/52AN+KWTMZrs5dtC000rnxHh2U fou0oxKaCesgirHwVu/nWaFcSrVOWO224MdALE6idmu9lavgqn/fbLCFHHnfF5RDSlDz wJV05DXfvEFsD/zLM5lPbDSabczl9W4RrFkqfBHGSvhm9Fpm4kCRpYqSp91XITjiQXL/ NXRlAnDsT0vYBLKgSJc0H3Y4crl2+8yv26kLZTDUgTQXrrov4voDU6kQq0Rvs3rMWYTK FvP2IUjMdgDgeYrj9Mul0Sp4D4Dy65ZpcLHkVpBwusjz69VvKK2BsRqsSIpj+fO4S1PW k6hw== X-Gm-Message-State: AJIora+HPvH2PjXCIzm2XFqe0+yPYm79MyLyrozCsykXu/oAV6K1ELrP gcOc1TNa1MDweJ40qFBm3ztqgyXZDkTsKg== X-Google-Smtp-Source: AGRyM1ubEmX5ZbaQ76ViuMAErihNPK7DYUmBh4N/lK+FvqKgpT76mIWub1Xi3M86GxUlf2VrXNRbYg== X-Received: by 2002:a05:600c:3494:b0:3a0:37f0:86ad with SMTP id a20-20020a05600c349400b003a037f086admr15805479wmq.65.1657539460345; Mon, 11 Jul 2022 04:37:40 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5562463wrr.39.2022.07.11.04.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 04:37:39 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: "brian m . carlson" , Junio C Hamano , rsbecker@nexbridge.com, =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH 2/4] .clang-format: Add a BitFieldColonSpacing=None rule Date: Mon, 11 Jul 2022 13:37:26 +0200 Message-Id: X-Mailer: git-send-email 2.37.0.913.g189dca38629 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Formatting bitfield as "unsigned foo:1" is the usual style in this project, not "unsigned foo : 1", which clang-format will use by default. Before & after this change running "make style-all-diff-apply" will yield: 582 files changed, 32029 insertions(+), 29794 deletions(-) 579 files changed, 32065 insertions(+), 29818 deletions(-) However this highlights a major limitation in this approach, because clang-format v12 or newer is required for this rule, but that version was only released in April 2021. This change therefore cuts off anyone using an older clang-format. We could decide to dynamically detect the version, and only supply this as a --style="" rule on the command-line for older versions, but then users on older versions would get different results. So what do we do about that? Declare that "make style" is what mortal users should run, but that we're going to run "make style-all-diff-ok" on some blessed version of clang-format? Signed-off-by: Ævar Arnfjörð Bjarmason --- .clang-format | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.clang-format b/.clang-format index 3f536c49f24..87398d24d4f 100644 --- a/.clang-format +++ b/.clang-format @@ -144,6 +144,10 @@ SpacesInParentheses: false # int a[5]; not int a[ 5 ]; SpacesInSquareBrackets: false +# Use "unsigned bf:2;", not "bf : 2" or whatever. Requires +# clang-format 12. +BitFieldColonSpacing: None + # Insert a space after '{' and before '}' in struct initializers Cpp11BracedListStyle: false From patchwork Mon Jul 11 11:37:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12913412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B57A3CCA47B for ; Mon, 11 Jul 2022 11:43:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbiGKLnT (ORCPT ); Mon, 11 Jul 2022 07:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbiGKLmx (ORCPT ); Mon, 11 Jul 2022 07:42:53 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A0010B3 for ; Mon, 11 Jul 2022 04:37:44 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id c131-20020a1c3589000000b003a2cc290135so3300019wma.2 for ; Mon, 11 Jul 2022 04:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hlrz4df2zil4nrird2oXWnmuvtrM+sp5lwwp4WWgiHM=; b=FMBdhj1JcSN8jocVffJwG9HIghRzudIxhtEGD3d53qz7ErSmK25yKJS/bgaAKSEEl5 fkD9EYm6WLO175gRbwzuSbNUp4SSP6qHHhN5WRgGZbQmpoK1AIPhO8QUbROkR0GwH7Jb 9CzZ04ZN9bJFkpnBEcy137DIpx0FPyjg7i3n11msFmXujKvBCv62KojbmQsCjGjs9gDQ 9GAHdAxkfgIh/bxHtVK1YoHHEXaAkS16JZnG/y9pFYqtSqndmqgF1ozWpBzJNS8KJphO ixVm1rahWExHEn9h+yofwVob7QTp8IxXqAmGm7pWQHYi5b73AcV5aXd4nDaKtPZlWtk1 9vvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hlrz4df2zil4nrird2oXWnmuvtrM+sp5lwwp4WWgiHM=; b=OYuhCwglQ0v5AF6Xbgz5q6bml9VbUqqEHiaOTer+t3xVCZ4+7Wlrfh1VxEpsQ2Hzik JbPqlerHLItVIqpXsuKG7dJRWzelJuvs/mRqEOB8/n7CZR7C5JYRJe+uBnSPKxOnMpze n7SIw2E6pESGpizJtjjmBINEB3kxB9w253lSmMSbSF8IEvtPK1JRvrnBqLFwXHdgTYO4 O6M7AYHOK83L2Db3fKAu5k7ESEaI8HsyD1WMTNypBWu59l0utB7hV2AryhyuS3G0OZss fPLQXXa7U8IM5R1wJnC7cAiOK2kjZ/0f7UIziRKoEZVgMUfBdMlMkRkjSZk4SCHLOery oInw== X-Gm-Message-State: AJIora+8AdXCjC2DPa0VleJtZv1HMBUQqKcjbwwdfWBfEXbytGJWgNzS eRogyU3oaHrTAF0n8HgYdmLOsRM0bTVrTA== X-Google-Smtp-Source: AGRyM1vlIDk2XhcOi4gxWpE0BBOTo7hvBjrhp2/dcMIlvUq8RIxXU+KulpheQuzecryId1s+5zNoiA== X-Received: by 2002:a05:600c:2d86:b0:3a2:eac9:ea0d with SMTP id i6-20020a05600c2d8600b003a2eac9ea0dmr509670wmg.105.1657539462272; Mon, 11 Jul 2022 04:37:42 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5562463wrr.39.2022.07.11.04.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 04:37:41 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: "brian m . carlson" , Junio C Hamano , rsbecker@nexbridge.com, =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH 3/4] .clang-format: do not enforce a ColumnLimit Date: Mon, 11 Jul 2022 13:37:27 +0200 Message-Id: X-Mailer: git-send-email 2.37.0.913.g189dca38629 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Our Documentation/CodingGuidelines mention that "We try to keep to at most 80 characters per line", but in reality we have a lot of code that runs afoul of that rule. Before & after this change running "make style-all-diff-apply" will yield: 579 files changed, 32065 insertions(+), 29818 deletions(-) 509 files changed, 13042 insertions(+), 12745 deletions(-) As with the preceding change what this leaves us with an unresolved question though, should we have some stricter version of "make style-all" that incorporates "ColumnLimit: 80", or perhaps apply it only on "make style", but then what if someone modifies code that happens to e.g. search/replace a line running afoul of the limit? Signed-off-by: Ævar Arnfjörð Bjarmason --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 87398d24d4f..5a106d959be 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,7 @@ UseTab: Always TabWidth: 8 IndentWidth: 8 ContinuationIndentWidth: 8 -ColumnLimit: 80 +ColumnLimit: 0 # C Language specifics Language: Cpp From patchwork Mon Jul 11 11:37:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12913413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00523C433EF for ; Mon, 11 Jul 2022 11:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbiGKLnU (ORCPT ); Mon, 11 Jul 2022 07:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230183AbiGKLmy (ORCPT ); Mon, 11 Jul 2022 07:42:54 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF05A219A for ; Mon, 11 Jul 2022 04:37:45 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id r10so452800wrv.4 for ; Mon, 11 Jul 2022 04:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GljN58UmSWv9ZCZ3wcziFOnC3XNhg25DsEjzL8nO6nM=; b=alxvCqO65fE5RQAXVA44uLVftVGyKJ9wzjkNhvOZS3GTok/FBEzsgyvkdIOEK9YvNM 9sQkqVE+CnCgF8iLdrpxj2N5oQl8NGjdybG6JszgjvDnKU6JoS0oK18/iJUMnWNtoTq3 /Cy+xfafrquQVbbxC6dMcNHzU856i3kFgh8zuHXYAMRHvs81nNMrj43OMgb0roOoaeLb VGPzX3OrftpNWoeP5V7B1HT5u345lKxHDd/aX8BQgn+rlvoaY3pvV8LNEAVqszkWFvi9 19yOVZ7WhNEXDA1RgZxcmtHAqkLHImprlmlT9nCC52NyOFJLT87hHa+JD4rYzzgj0w1J QpxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GljN58UmSWv9ZCZ3wcziFOnC3XNhg25DsEjzL8nO6nM=; b=WMNtwPIBD/RJV/TlRJ2DnWRzu7MNML/5GMvE5wLS1A7KFuMaLxbZsja83t06CqbQXq k842h+P4zxbil0MrDy1DR+j2ZqKal3j+gKVoKqAv80T4gX9sLvuM679IAjDYi1MeJLZv RJM3GWwXUr2DU+hZaJnchgkL+yBnUVhzBngxp9W/HkjhyP1tC/tzbXT5JDwMZ1FkcESH X4/fCCcOqWA+nR/tucM5LAn+9oLYLty7WIp/U2xbtoavSPArcu25J/swelb9pIwR3iaC UduL0A2Nl2PLElkB9/h9s1XA6NxldnV2kslY+cuszesxJvESZ1qEbW4l+hx27io6cM8n VWlQ== X-Gm-Message-State: AJIora+vdLfTyvs4HCMPIxexu2NvzI179fehqdpJNCcUFt6m+gjGBfgy Bst615N9Vkm8UbyNDfDMj594YnLy01QyEQ== X-Google-Smtp-Source: AGRyM1tB5l+IXRCVDiMHgWKd4w933tCWCAJzt4MH3GiQ1KcNxvg/iplLQnlOUVy1Gy+3dRbY0Klj6Q== X-Received: by 2002:a5d:4807:0:b0:21d:925b:d867 with SMTP id l7-20020a5d4807000000b0021d925bd867mr15430451wrq.354.1657539464148; Mon, 11 Jul 2022 04:37:44 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5562463wrr.39.2022.07.11.04.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 04:37:42 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: "brian m . carlson" , Junio C Hamano , rsbecker@nexbridge.com, =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH 4/4] .clang-format: don't indent "goto" labels Date: Mon, 11 Jul 2022 13:37:28 +0200 Message-Id: X-Mailer: git-send-email 2.37.0.913.g189dca38629 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This change is a slightly mixed bag, we have a lot of "goto" labels that are indented by exactly one space. Before & after this change running "make style-all-diff-apply" will yield: 509 files changed, 13042 insertions(+), 12745 deletions(-) 510 files changed, 13039 insertions(+), 12742 deletions(-) Signed-off-by: Ævar Arnfjörð Bjarmason --- .clang-format | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.clang-format b/.clang-format index 5a106d959be..56d7e8f9def 100644 --- a/.clang-format +++ b/.clang-format @@ -148,6 +148,9 @@ SpacesInSquareBrackets: false # clang-format 12. BitFieldColonSpacing: None +# Do not indent "goto" labels, they should be flushed left. +IndentGotoLabels: false + # Insert a space after '{' and before '}' in struct initializers Cpp11BracedListStyle: false