From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id CDF624DA51
	for <ffmpegdev@gitmailbox.com>; Mon, 21 Apr 2025 23:52:58 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 91F3C687C7C;
	Tue, 22 Apr 2025 02:52:54 +0300 (EEST)
Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com
 [209.85.214.175])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1168F687C7C
 for <ffmpeg-devel@ffmpeg.org>; Tue, 22 Apr 2025 02:52:48 +0300 (EEST)
Received: by mail-pl1-f175.google.com with SMTP id
 d9443c01a7336-223fd89d036so55144335ad.1
 for <ffmpeg-devel@ffmpeg.org>; Mon, 21 Apr 2025 16:52:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1745279566; x=1745884366; darn=ffmpeg.org;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :message-id:from:from:to:cc:subject:date:message-id:reply-to;
 bh=nTuxZzcxiLFWwp/a3Qzuo7AOjrlZoE2MxG7yhAaO1K0=;
 b=cExEmpE5AKueTOTwGla1UvPDEswXiHIwVsZJ5s0UsVOMqGn/ewjAXPSWj6UNOHwtcO
 v75mxPvO/bCJQBO5+kVeJpjP4aiLCAbt5qBWocF0Bpf6Nlm7Ee+l2dRd+hpxFpj76L+d
 jioEM8YiDqD7usZLN7jxIg36AE6tEocJRHTbaaGf8pmC+Y7Q+h3c2df0sgtogwW5W9+v
 Pdw3c0j5JfjxQVdxZi3xBYY98HpsTFMUHaMNqJnN7Cn7gFHhETpNewG7vR6IoqscFHp/
 dlQXCuC57KEb6+uJ5K259Hzwg+V5KRziC7NxuqtVwjkWh3mAsmiHWVDgdv+Cx8X+OlOe
 EZkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1745279566; x=1745884366;
 h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date
 :message-id:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=nTuxZzcxiLFWwp/a3Qzuo7AOjrlZoE2MxG7yhAaO1K0=;
 b=UrZWH4YguEqexRPCHeUcj3kyVCTYk1PJ8bWUrUkIE+ybqFs/lovXNy5ifVgkPI8gn5
 Twx7b/lr/gcZkQxc7lC8FWLxJ9mppiVPZFW/1kvIDHM/zmN1H/Oqx+MAOsiXSoPApCnn
 /AvMuiigCIqMm5MydilarX5Z5vsrdK+Wh12UcOtvOViUJZaXgOEPalMPhRc9B0ElECPX
 lmbKPMGGlyazTxgkvFv2HcP65Utl+JI0LNDa/pY7ZkKLSd3Oa4aVQ7ZPy3p8P6ifWL7P
 SjM7DHgdX/2Yp5wAuMndODkIwyIEssOIfe8UrUjTJ9kkzVm/f/XbvvrG2DOdX8sPbJdP
 z/Mg==
X-Gm-Message-State: AOJu0Yy4qYHKyr594eZzpcO85Stv3KjeYjTQRfgzqbf/CguWqYaYQorl
 tbBtsNIv0bOZhIUR0xPxfbM9LIHORPVT1YPg/XqzOH9QI8oseUau2a1NGg==
X-Gm-Gg: ASbGnctz5/sml69jvW356nmfyw153JcB9oaiXJOgOdSO9TDynKi9Ix3J8SjufjGWHpF
 rV450SI1OF3uFF1pkzTJaDJlhK2qDXiHLuWyZa9aSGKM4azWmhA4r0vk3QPZd4x2I38yBppF9JF
 I3AQyPQJ8pj7THFfkZlEmrm2gC1LbOgeYkhj4YuKddgTac0AUVcfaGewkzOAk+fZ9mX3bjnhZ4f
 O63ZjBDnMeBszLCwBm3UJOUROqfZ3A7fRYk19gv2uGJCcsOOItRUAv1f5DCzfCW9uSF0sgV9MOT
 7Ku6OteRRZ4opg==
X-Google-Smtp-Source: AGHT+IGvg6ZlAuHH0GX0779SN9XwFw5l7YyYjYJZxY2IIJbPBOCKcVmApjEIgAduxMkvFlAQqZgAsw==
X-Received: by 2002:a17:902:ce01:b0:223:569d:9a8b with SMTP id
 d9443c01a7336-22c53580d1dmr168994485ad.18.1745279565549; 
 Mon, 21 Apr 2025 16:52:45 -0700 (PDT)
Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-22c50ed1d63sm71530465ad.198.2025.04.21.16.52.45
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 21 Apr 2025 16:52:45 -0700 (PDT)
From: softworkz <ffmpegagent@gmail.com>
X-Google-Original-From: softworkz <softworkz@hotmail.com>
Message-Id: <pull.74.ffstaging.FFmpeg.1745279559776.ffmpegagent@gmail.com>
Date: Mon, 21 Apr 2025 23:52:39 +0000
Fcc: Sent
MIME-Version: 1.0
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] [RFC] global/clang-format: Add .clang-format
 configuration for consistent formatting
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: softworkz <softworkz@hotmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/pull.74.ffstaging.FFmpeg.1745279559776.ffmpegagent@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

From: softworkz <softworkz@hotmail.com>

This is an attempt to create and establish a common definition for
code formatting. Besides .clang-format, there don't seem to be many
good candidates for C when looking for non-proprietary open-source
solutions, so there's wasn't really much choice.

I have tried to configure everything according to the current
guidelines, to which it should come pretty close. There are a few
things for which I couldn't find any FFmpeg rules, or where it wasn't
clear and I made choices that seemed reasonable.

This is in no way intended to prescribe any formatting detail rules,
it's rather meant as an invitation to collaborate on this and ideally
end up with something "official" that allows to check and fix
formatting in CI flows or Patchwork and locally for everybody using
editors with clang-format support or using clang-format from the
command line.

Signed-off-by: softworkz <softworkz@hotmail.com>
---
    [RFC] global/clang-format: Add .clang-format configuration for
    consistent formatting
    
    This is an attempt to create and establish a common definition for code
    formatting. Besides .clang-format, there don't seem to be many good
    candidates for C when looking for non-proprietary open-source solutions,
    so there's wasn't really much choice.
    
    I have tried to configure everything according to the current
    guidelines, to which it should come pretty close. There are a few things
    for which I couldn't find any FFmpeg rules, or where it wasn't clear and
    I made choices that seemed reasonable.
    
    This is in no way intended to prescribe any formatting detail rules,
    it's rather meant as an invitation to collaborate on this and ideally
    end up with something "official" that allows to check and fix formatting
    in CI flows or Patchwork and locally for everybody using editors with
    clang-format support or using clang-format from the command line.
    
    Signed-off-by: softworkz softworkz@hotmail.com

Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-74%2Fsoftworkz%2Fsubmit_clang_format-v1
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-74/softworkz/submit_clang_format-v1
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/74

 .clang-format | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 .clang-format

diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000000..e49e571d48
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,81 @@
+---
+BasedOnStyle:    GNU
+
+# Alignment & indentation rules
+AlignAfterOpenBracket:               Align
+AlignConsecutiveAssignments:         Consecutive
+AlignConsecutiveDeclarations:        AcrossEmptyLinesAndComments
+AlignArrayOfStructures:              Left
+AlignOperands:                       false
+AlignTrailingComments:               Always
+AlignEscapedNewlines:                LeftWithLastLine
+IndentWidth:                         4
+ContinuationIndentWidth:             4
+UseTab:                              Never
+TabWidth:                            4
+IndentPPDirectives:                  None
+IndentCaseBlocks:                    true
+IndentCaseLabels:                    false
+IndentGotoLabels:                    true
+PointerAlignment:                    Right
+
+AlignConsecutiveShortCaseStatements:
+  Enabled: true
+  AcrossEmptyLines: true
+  AcrossComments: true
+  AlignCaseColons: false
+  
+# Bracing style                      
+BreakBeforeBraces:                   Custom
+BraceWrapping:                       
+  AfterCaseLabel:                    true
+  AfterControlStatement:             Never
+  AfterEnum:                         true
+  AfterFunction:                     true
+  AfterClass:                        false
+  AfterStruct:                       false
+  AfterUnion:                        false
+  AfterExternBlock:                  false
+  BeforeElse:                        false
+  SplitEmptyFunction:                true
+  SplitEmptyRecord:                  true
+BreakAfterReturnType:                None
+
+# Keep lines from becoming too long (adjust to your preference)
+ColumnLimit:                      0
+
+# Misc formatting
+AlwaysBreakAfterReturnType:       None
+BinPackArguments:                 false
+BinPackParameters:                false
+# BinPackLongBracedList:            false
+BreakBeforeTernaryOperators:      true
+InsertNewlineAtEOF:               true
+MaxEmptyLinesToKeep:              2
+AlwaysBreakAfterDefinitionReturnType: None
+
+# Include style
+SortIncludes:                     Never
+IncludeBlocks:                    Preserve
+IncludeCategories:
+  - Regex: '^<.*'
+    Priority: 1
+  - Regex: '^".*'
+    Priority: 2
+  - Regex: '.*'
+    Priority: 3
+
+# Spacing
+SpaceAfterCStyleCast:            false
+SpaceAfterLogicalNot:            false
+SpaceBeforeAssignmentOperators:  true
+SpaceBeforeParens:               ControlStatements
+SpaceBeforeSquareBrackets:       false
+SpaceInEmptyParentheses:         false
+SpacesBeforeTrailingComments:    1
+SpacesInAngles:                  false
+SpacesInConditionalStatement:    false
+SpacesInCStyleCastParentheses:   false
+SpacesInParentheses:             false
+SpacesInSquareBrackets:          false
+...

base-commit: b6c2498a5902766f924cc8728ac65d4fbfd95238
-- 
ffmpeg-codebot
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".