Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp665732rwd; Wed, 14 Jun 2023 23:46:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4EOkBGrXrZKyy2xQu/AJ+GdcMOJEhg/YnunaXJOBLlah/nwm3KwlxESrT9XdY/KnzH7dVh X-Received: by 2002:aa7:d9c1:0:b0:518:6e09:425c with SMTP id v1-20020aa7d9c1000000b005186e09425cmr5452937eds.9.1686811614272; Wed, 14 Jun 2023 23:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686811614; cv=none; d=google.com; s=arc-20160816; b=ckSGleGdOBO3Mp8X4LyRKXwZD131Pke/hxOaQYcI83PRa9VbXd2hQm0mZtoC8wHw3q I01Z4gz3s37TsqBEy69f8WSuqeymiXfvyoCXsKY0d6POQTQwviF+CMH+SCdFcsSwdhbn nyMHkM708A260WxgC6R3U/jlajfH1sAzQviOEsKew8nXmFU/VjyIvOwr9EIlKY8IDqEQ bjzJYlv8+3Srw4wj6LZfxeKBz9RqUbRnbkSxKF0tQaXmZjp8O6Z7m08cyEhuF1QkptE4 a38RF5yPmu3Bql95mXUvjhC2xWjRWr8CmoAiel7rn2XjnHNNmgaxNqHiUAVePhiLzXtL gR2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=X4wlkttPOcasVDRYX1HT0XHqYNDJfm6yG6bhk7nZo7o=; b=Rc5alrJhHltaMikt8Pan32yXdYPrsdJmjz7yyUSGBcWEPw0gk1AmC6ASOoppo9tA9D rgDknrZ7uoDu3Dm4TsVIQ4fFp9qw3y5FN2hIQGLgfK95xBxf5xmL8IDo50IXC/Cej7Mv c5RzWmCwfGztbViDtnrxkPoRbVtilbR+Jfqf0CTfelKRsaURHe+gcivK0NTFYPS/G6Al xfVROq3ffWVVyepVQJzwficFIo+wQHH4V7/xbR/v+SU8JsNjvyDHOH21H7FgSYW0Hu8Z Mz2Pz9Q/04DIiOJr8wG4IUUjhmGYuhFu1cGWKQsN8DX1gsX6SEj8Y3HTQhnyEcB9iiDv w3HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZJlZQzCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a056402070400b005185ef879a5si4193443edx.522.2023.06.14.23.46.28; Wed, 14 Jun 2023 23:46:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZJlZQzCx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238058AbjFOGiY (ORCPT + 99 others); Thu, 15 Jun 2023 02:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244020AbjFOGhh (ORCPT ); Thu, 15 Jun 2023 02:37:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7256F30E9 for ; Wed, 14 Jun 2023 23:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686810945; 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: in-reply-to:in-reply-to:references:references; bh=X4wlkttPOcasVDRYX1HT0XHqYNDJfm6yG6bhk7nZo7o=; b=ZJlZQzCx4MwBE4O8FUYvQ8BvwM3TkHT6tHQ229xjJYXbjzsnvYvWC8uWjkQm7jrJJri8en vdtDNlc/VU1baqFJF2Tsfi+SF6AJ0vTSVq+7HhILfbmYlX10N4MTpn2NvBsBhKDV7h6hM6 WpL7qNLqQVAfhuLjpGwLe4/XEU1Ib0g= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-aVWubZCdNO64MUtqpU1GzQ-1; Thu, 15 Jun 2023 02:35:43 -0400 X-MC-Unique: aVWubZCdNO64MUtqpU1GzQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b448e0a667so94661fa.1 for ; Wed, 14 Jun 2023 23:35:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686810942; x=1689402942; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X4wlkttPOcasVDRYX1HT0XHqYNDJfm6yG6bhk7nZo7o=; b=cpYAfKZKW4JFj61JNSZUr3ZSon5BUfet63Aqru+738EYJngc0TuyVT61u8AcWgo3rP E66nzN3gLjBZvj03EgiR0W8VGx6Hfrh1mgWnLY6hNmD+km5AGNgaIsSt8yOumnkTH90j Jg3ZibS/tv0LCBX8sTls7eVU+z5G9hp5NQKeq+GuS2Cv5oohpj9yXEplVAyLpkWimqwj FZo/D2jrOiXABbLOXQz7Jd3I5dJ4ApuOLwZ4sqY9cx6PcKTfnMZb6BY1vBpWVcAMNVZq +uL1r0S2FEIeMeze/tgP+YM1kWW3056TLB/zrrGnqGzb2k10hDP0ec55+Y+4YIdskuav evUA== X-Gm-Message-State: AC+VfDyhTooqrlMckpaR9DuvCGR/3blYuJN5H6Q8D4sRQzlm3LBXtv3N B/HeFKvzSGq5VUkWiRAgwXvbSdU6V7eoBESevAMDGQJ1Uic21S9btjKIbZjC7ljye2u7IlMK7Jg VwrWdRx1A43666Az1La1ZlFhFcaiC6835fiSuPmuh X-Received: by 2002:a2e:b04e:0:b0:2ad:b01b:d458 with SMTP id d14-20020a2eb04e000000b002adb01bd458mr8414319ljl.30.1686810942357; Wed, 14 Jun 2023 23:35:42 -0700 (PDT) X-Received: by 2002:a2e:b04e:0:b0:2ad:b01b:d458 with SMTP id d14-20020a2eb04e000000b002adb01bd458mr8414295ljl.30.1686810941918; Wed, 14 Jun 2023 23:35:41 -0700 (PDT) MIME-Version: 1.0 References: <20230601075333.14021-1-ihuguet@redhat.com> <87sfb1oz13.fsf@meer.lwn.net> <8f27ad5f-9a9c-3db0-a934-88e1810974f3@digikod.net> In-Reply-To: From: =?UTF-8?B?w43DsWlnbyBIdWd1ZXQ=?= Date: Thu, 15 Jun 2023 08:35:30 +0200 Message-ID: Subject: Re: [PATCH v4] Add .editorconfig file for basic formatting To: Vincent MAILHOL Cc: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Jonathan Corbet , ojeda@kernel.org, danny@kdrag0n.dev, masahiroy@kernel.org, jgg@nvidia.com, linux-kernel@vger.kernel.org, joe@perches.com, linux@rasmusvillemoes.dk, willy@infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 15, 2023 at 4:40=E2=80=AFAM Vincent MAILHOL wrote: > > On Wed. 14 Jun. 2023 at 22:04, =C3=8D=C3=B1igo Huguet wrote: > > On Wed, Jun 14, 2023 at 2:55=E2=80=AFPM Vincent MAILHOL wrote: > > > On Wed. 14 Jun. 2023 at 20:40, =C3=8D=C3=B1igo Huguet wrote: > > (...) > > > > > Right now I see 2 possibilities: > > > > - Provide an .editorconfig.default so those that want to use it, ca= n > > > > do it. But I wouldn't mess with cherry-picking directories that > > > > already complies and those that don't, just the developer chooses t= o > > > > use it or not, and that's all. > > > > - Provide an .editorconfig directly, and those that don't want to u= se > > > > it, either disable it in their editors or manually delete the file. > > > > > > > > Please tell me what approach you prefer. > > > > > > Personally, I vote for the latter. My honest opinion is that we are > > > putting too much consideration into the risk of rejections. > > > > I completely agree. > > > > > =C3=8D=C3=B1igo previously stated that editors such as Kate can not o= pt out. I > > > think that the reason is simply that no one has complained about it s= o > > > far. I did some research on the internet with the keyword "kate > > > disable editorconfig", and nothing relevant appeared. A deeper > > > research made me found this: > > > > I have not "complained", but I have filled a request just today, that > > I think won't reach far: https://bugs.kde.org/show_bug.cgi?id=3D471008 > > Wow! That's a lot of investment on your side. Clearly, there is no > appetite from the maintainers. But if something needs to be done > (which I doubt), I think it should be on the editor's side rather than > on the project using that .editorconfig file. > > > > KatePart has support for reading configurations from > > > .editorconfig files, when the editorconfig library is > > > installed. KatePart automatically searches for a .editorconfig > > > whenever you open a file. It gives priority to .kateconfig > > > files, though. > > > > > > source: https://docs.kde.org/stable5/en/kate/katepart/config-variable= s.html > > > > > > So it appears that for Kate, installing the editorconfig lib is a > > > prerequisite. I think it falls in the opt-in category. > > > > I'm not 100% sure, but I think that this is a requisite at build time. > > So unless you build Kate from source, it will be built-in without > > opt-out choice. > > It seems you are right. On Ubuntu, the "kate" package actually depends > on "libeditorconfig0", so indeed, that's a hard dependency. My bad. > > That said, on source based distribution, it should be configurable. > Taking gentoo as an example, you get an editorconfig USEFLAG which > allows to choose whether or not you enable editorconfig during the > compilation: > > https://packages.gentoo.org/packages/kde-frameworks/ktexteditor > > I continued my investigation. Here is the commit which adds > editorconfig to ktexteditor (used by kate): > > https://github.com/KDE/ktexteditor/commit/f9f133b6ac72dfa12bdeeab1a37c5= e9dc9a9354e > > Looking at what the code does, it first walk through the absolute path > in reverse and if it finds a .kateconfig file, it does an early > return: > > https://github.com/KDE/ktexteditor/blob/f9f133b6ac72dfa12bdeeab1a37c5e9= dc9a9354e/src/document/katedocument.cpp#L2578 > > This should act as a kill switch. Not tested, but adding a .kateconfig > seems like a valid opt out method. This is consistent with the > paragraph I quoted in my previous message: > > It gives priority to .kateconfig files, though. > > Problem solved? Very good catch. I have tried and adding an empty .kateconfig file makes that .editorconfig is ignored. For me this is a simple enough workaround. We can document it as a comment in the top of .editorconfig file. > > > > Is there really an editor with default opt-in and no options to > > > opt-out? I doubt... > > > > Kate is the only one I have seen so far, but it's difficult to know. > > > > > I really think we should have the .editorconfig at the root and for > > > the rare edge cases where the user really wants to opt-out, I > > > sincerely believe that there will be solutions. I have seen many > > > projects using it and I do not recall push backs or complaints. > --=20 =C3=8D=C3=B1igo Huguet