From patchwork Mon Sep 16 09:56:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Min Mina Chou X-Patchwork-Id: 1986072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=3KXEIRtS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X6gLT40dKz1y1g for ; Mon, 16 Sep 2024 19:57:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ax4pMHlcWUXVQtpQRisen/f08pb43Ooxl6GJpuI/vPs=; b=3KXEIRtSAy4ZLH Xzi4SjGybaRcRrbWFmEy3mQffYlCY5xiTtfAVgBm5ZZLnpUnXY2LoJoTlajuAoBluQttg495/QuIR 2iGTxtxi/CqCh5LX3BPP23WHvyWXVksRfCCeGPxW90T5Mc9zyKJQdy1P8TVMUHFRNnY64UHD8x9u6 2JviiLQqf+sMKwBu5OkL5EKLNNck28Yf6qO+Yk0GmJMAnTVGuNqfn1x8fnedW6Y5uZ+kGY2VsMarR A4ctsWb11WnIjTxe31WrFHNN36exBvaStNmiFKy+izs+gGJg8DYpWMZNAYJNc03PXMRIPU6HxaKZ7 kL2hhZ/PYo9XasW9HV/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sq8TZ-00000003dSU-09QB; Mon, 16 Sep 2024 09:56:57 +0000 Received: from 60-248-80-70.hinet-ip.hinet.net ([60.248.80.70] helo=Atcsqr.andestech.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sq8TV-00000003dRO-0CRR for opensbi@lists.infradead.org; Mon, 16 Sep 2024 09:56:55 +0000 Received: from mail.andestech.com (ATCPCS34.andestech.com [10.0.1.134]) by Atcsqr.andestech.com with ESMTPS id 48G9uhix056643 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=OK); Mon, 16 Sep 2024 17:56:43 +0800 (+08) (envelope-from minachou@andestech.com) Received: from swlinux02.andestech.com (10.0.15.183) by ATCPCS34.andestech.com (10.0.1.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 16 Sep 2024 17:56:44 +0800 From: Hui Min Mina Chou To: CC: , , , , Hui Min Mina Chou Subject: [PATCH] top: Add .editorconfig to set basic coding styles Date: Mon, 16 Sep 2024 17:56:36 +0800 Message-ID: <20240916095636.603355-1-minachou@andestech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.0.15.183] X-ClientProxiedBy: ATCPCS33.andestech.com (10.0.1.100) To ATCPCS34.andestech.com (10.0.1.134) X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 48G9uhix056643 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_025653_386724_8197FCC1 X-CRM114-Status: GOOD ( 12.39 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: EditorConfig [1] ensures consistent coding styles for developers collaborating on the same project across various editors and IDEs. By adopting the Linux project's .editorconfig settings [2] and apply [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [60.248.80.70 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address 1.0 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org EditorConfig [1] ensures consistent coding styles for developers collaborating on the same project across various editors and IDEs. By adopting the Linux project's .editorconfig settings [2] and applying them to OpenSBI, it helps users maintain uniform indentation across different IDEs and version control systems, improving development efficiency. The main difference from Linux project is the addition of 'trim_trailing_whitespace = true', which removes trailing whitespace before newlines. This change affects only three files in OpenSBI, but it improves overall code consistency. $ grep -nr "\s$" --include={*.{c,dts,h,lds,ldS,mk,s,S.py},Kconfig,Makefile,Makefile.*} . ./include/sbi_utils/fdt/fdt_fixup.h:4: * Implement platform specific DT fixups on top of libfdt. ./platform/generic/platform.c:79: * The fw_platform_coldboot_harts_init() function is called by fw_platform_init() ./platform/generic/platform.c:81: * according to the DT property "cold-boot-harts" in "/chosen/opensbi-config" Link: https://editorconfig.org/ [1] Link: https://lore.kernel.org/lkml/ZbAbmchIO8Cd5hNd@surfacebook.localdomain/T/ [2] Signed-off-by: Hui Min Mina Chou Reviewed-by: Anup Patel --- .editorconfig | 21 +++++++++++++++++++++ .gitignore | 1 + 2 files changed, 22 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..e66b1ca3d6e7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-only +# See here for more information about the format and editor support: +# https://editorconfig.org/ + +root = true + +[{*.{c,dts,h,lds,ldS,mk,s,S},Kconfig,Makefile,Makefile.*}] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = tab +indent_size = 8 + +[*.py] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore index a519d67f5c54..424302b38337 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ !.clang-format !.gitignore +!.editorconfig # Object files *.o