diff mbox series

[RFC,4/4] .clang-format: don't indent "goto" labels

Message ID RFC-patch-4.4-e3a95c62bda-20220711T110019Z-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series make headway towards a clean "clang-format" | expand

Commit Message

Ævar Arnfjörð Bjarmason July 11, 2022, 11:37 a.m. UTC
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 <avarab@gmail.com>
---
 .clang-format | 3 +++
 1 file changed, 3 insertions(+)

Comments

Junio C Hamano July 11, 2022, 9:04 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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(-)

More files changed with fewer changes, or the above is not
copy-and-paste but typed in?

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  .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
Ævar Arnfjörð Bjarmason July 12, 2022, 6:55 a.m. UTC | #2
On Mon, Jul 11 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> 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(-)
>
> More files changed with fewer changes, or the above is not
> copy-and-paste but typed in?

It's copy/pasted, i.e. it's hit & miss when you massage these settings
if we change more files, or change fewer lines or whatever, and thes may
not be the same changes in the same files...
diff mbox series

Patch

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