From patchwork Fri Oct 27 12:10:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Meng X-Patchwork-Id: 1856180 X-Patchwork-Delegate: aconole@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ntn5Jq0P; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::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 4SH1j31PSrz202k for ; Fri, 27 Oct 2023 23:11:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 70ABD416BB; Fri, 27 Oct 2023 12:11:00 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 70ABD416BB Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ntn5Jq0P X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jrxs9b09DU-1; Fri, 27 Oct 2023 12:10:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2FDB0402C3; Fri, 27 Oct 2023 12:10:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2FDB0402C3 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DC291C0039; Fri, 27 Oct 2023 12:10:57 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 96012C0032 for ; Fri, 27 Oct 2023 12:10:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5DAC64F031 for ; Fri, 27 Oct 2023 12:10:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5DAC64F031 Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ntn5Jq0P X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nk5wvR6VjvzM for ; Fri, 27 Oct 2023 12:10:55 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 552E54F023 for ; Fri, 27 Oct 2023 12:10:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 552E54F023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698408654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5CmxLeVrf193JBo1CCRG7aoEAmzA26/rOi6YdA5U8GE=; b=Ntn5Jq0P1DmjMGibjaCAzgCzkSSmVL0EPnsjjyXxpXHxDpuSzAEhv4C1/wEWVhCngPuOVE NgMWFSpJpujCx43OKzileldEdUXZOXVzplO94u4F6arca3e4jdjAzXu8mSvu+GSJuz/03H KXFS0NXcIP1iw9wYd1TyKEx756c/vns= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-57-Kmq1UCw6P0eXQgYYSJAu8Q-1; Fri, 27 Oct 2023 08:10:52 -0400 X-MC-Unique: Kmq1UCw6P0eXQgYYSJAu8Q-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3fe182913c5so15373315e9.0 for ; Fri, 27 Oct 2023 05:10:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698408650; x=1699013450; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5CmxLeVrf193JBo1CCRG7aoEAmzA26/rOi6YdA5U8GE=; b=N+71fsYCJvoAsB+Zg/LMzHTHgouoDyGb4AIu3KVnTV1NUFhI5LgHPHEwkvSMQruXDP 4r95G6DgocVS2OIRhjIaFldU2SBgFyZfh/L17dd825M3bZExb5ZM5IocRNiq4LY6LHHH b6I/MbVL7uIzmEL4zYXoZbdzdSWlgEtYXfj60l1heReO09YQr7kP0RMCeqYWO62wdL/Y D9LZgb3ldPo3IkMylBc0xOsUiN8pwBWfUXIDTIo4traH/nfLAEk2yYewiZa48nqduw+U /AHcF0Jocn++74rtFxbdmv1qys54h3/ax/gwrUpeBQttsiCSllvKCR8Oz4Kr/4UsKGQy YpEQ== X-Gm-Message-State: AOJu0Yw6VRFSuztAVBHQSjn6I8YadkyTEpaugR+zg2WeKPO0GDIpIC3I rsWNJ1ELGhN/Xgmq9ydkHcavW/T4I0bM8+ta2Pbuz4C3R2dqjI7bjddFaOt9sdE50QuISrFlIf7 vYgBRGq8SLJazdJr9d4NPJ032O49oF2Se+fF76r+ua8p+MYS2zCTFhEFJM4mXCa0v9MU= X-Received: by 2002:a05:600c:3594:b0:405:4daa:6e3d with SMTP id p20-20020a05600c359400b004054daa6e3dmr2028464wmq.39.1698408650658; Fri, 27 Oct 2023 05:10:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHj4qMoi/x/a9V7i3kNxuS44skyy+73CjQ5xyUoYxdl+mp9DMMgAma9AoIYYUVKE9ZMGFfmzA== X-Received: by 2002:a05:600c:3594:b0:405:4daa:6e3d with SMTP id p20-20020a05600c359400b004054daa6e3dmr2028446wmq.39.1698408650239; Fri, 27 Oct 2023 05:10:50 -0700 (PDT) Received: from positronik4lide.redhat.com ([87.122.59.133]) by smtp.gmail.com with ESMTPSA id p9-20020adff209000000b00324853fc8adsm1638918wro.104.2023.10.27.05.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:10:49 -0700 (PDT) From: jmeng@redhat.com To: dev@openvswitch.org, rjarry@redhat.com, echaudro@redhat.com, mkp@redhat.com Date: Fri, 27 Oct 2023 14:10:40 +0200 Message-Id: <20231027121040.26751-1-jmeng@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v3] editorconfig: Remove [*] section and trim_trailing_whitespace. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Jakob Meng Wildcard sections [*] and [**] are unsafe because properties cannot be applied safely to any filetype in general. For example, IDEs like Visual Studio Code and KDevelop store configuration files in subfolders like .vscode or .kdev4. Properties from wildcard sections also apply to those files which is not safe in general. Another example are patches created with 'git format-patch' which can contain trailing whitespaces. When editing a patch, e.g. to fix a typo in the title, trailing whitespaces should not be removed. Property trim_trailing_whitespace should not be defined at all because it is interpreted differently by editors. Some wipe whitespaces from the whole file, others remove them from edited lines only and a few change their behavior between releases [0]. Limiting the property to a subset of files like *.c/*.h will not mitigate the issue: Multiple definitions of a whitespace exist. Unicode considers a form feed (0x0C) to be a whitespace [1]. QChar::isSpace() [2] from Qt follows this definition, causing the Kate editor identify a form feed as a trailing whitespace and removing it from sources [3]. This breaks patches when editors remove form feeds and thus causing broken patches which cannot be applied cleanly. Removing trim_trailing_whitespace will be a minor inconvienence, in particular because utilities/checkpatch.py and thus 0-day Robot will prevent trailing whitespaces for our definition of a whitespace. [0] https://github.com/KDE/ktexteditor/commit/94b328fc64e543d91930845d2a96ce08d3043295 [1] https://en.wikipedia.org/wiki/Whitespace_character [2] https://github.com/qt/qtbase/blob/5628600a07295db6ed6683e97fafb0c45ddea505/src/corelib/text/qchar.h#L554 [3] https://github.com/KDE/ktexteditor/blob/10210ec1dd06afa1e7b19a4fff722a8a23719161/src/document/katedocument.cpp#L5643 Fixes: 07f6d6a0cb51 ("Add editorconfig file.") Signed-off-by: Jakob Meng Acked-by: Eelco Chaudron Reviewed-by: Robin-Jarry --- .editorconfig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 685c72750..41ba51bf3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,15 +2,18 @@ root = true -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -charset = utf-8 +# No wildcard sections [*] and [**] because properties cannot be +# applied safely to any filetype in general. + +# Property trim_trailing_whitespace should not be defined at all +# because it is interpreted differently by editors. [*.{c,h}] +charset = utf-8 +end_of_line = lf indent_style = space indent_size = 4 +insert_final_newline = true max_line_length = 79 [include/linux/**.h]