Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp479375rwd; Wed, 14 Jun 2023 19:55:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6dYtf9iRajP4FdgVuTt5zJDnW58hSxObqK6njaL1Lq6PlVtrLPNdeaFeVPmQMkpm+yMi55 X-Received: by 2002:a05:6402:1849:b0:514:92d7:7d69 with SMTP id v9-20020a056402184900b0051492d77d69mr9667795edy.27.1686797708698; Wed, 14 Jun 2023 19:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686797708; cv=none; d=google.com; s=arc-20160816; b=rwsEjxJI5E5LJ9S+yg5+4PMD7VMK2433pZl4OmlTrexwACLFYvdS4wcdoWxr3u+msW 8v4Agppb8T2n2sSStWa5Si3tgykm9TETKGCZgrLuZI/x5gBfy6KG+Tu1v2A9Z9me4Z6Z +GtRqQ+r0lAcrMrI/ZwXcvzeQnzLEAid4yZVGo7UIyhgIU4K6TwG9fg5VRQZjiZ+bJMX hUUmQydwsbGDaXteKsl5KQRcM6HxO5JChioCBrd8QV3Frny2fBlJh93maym2txy5RD28 Z22EotztqtahPZot5gcEXPz+pUPo0D35C8OPOz73f06qGq/rHTL8FiuknhXl6eW8ZuPu z2ng== 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; bh=TD0n2ivePj7VjkNhE46dUXyC7w0mI6mRUwSWKkVJwbU=; b=j2dJr3cnASoqNXrkUZibbyyng3AHPFXOS2Fm0IZXoI9N+DdzHBT8rTusYYU9SnwMG9 ErUqizS9LEcp7bXbTfR5UWZXaSL5En9eQ5fXTe3xrgahm36w0IzavkZ77l4fKpHb5COa 4KgwwNTh8WHJZEknawVTQ82PgZ0mHMjzUSARR/RHpw8cIRBilr7JSMwQK9zNycfsb0ml aiKEiK4Ix3n1Vd76l3mhGZ+RXHAtjrFm48Sjw7LvRGhBgyOCEsNTtq0WUT1SlspbZjsp Q7vhzqsLwoHVQBsKf5HQMX/oSsj6OP2dFiDx/gATZUhbOfHQdu2StYMNHjqtN+Ej2d42 E/kA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a25-20020a50ff19000000b005183f72810fsi4588803edu.220.2023.06.14.19.54.37; Wed, 14 Jun 2023 19:55:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjFOCkj convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Jun 2023 22:40:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242178AbjFOCkg (ORCPT ); Wed, 14 Jun 2023 22:40:36 -0400 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62BE8269E for ; Wed, 14 Jun 2023 19:40:34 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-39e87ad392fso451412b6e.0 for ; Wed, 14 Jun 2023 19:40:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686796833; x=1689388833; 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=LzJECtrl96+oShM83EMIlq/tfEMuyZFqCkDk9mCEWHo=; b=cMMXn9gyB9RR6DsIJ4apQovdZFYDJXmXfP1SH/Ynsp1jdzxJiMRb4yRbRitrfBes0h vD2hneb0mGhys8WUy08Ar6ztHJzpTwUeZ3QFQfs+EgZNyob5oKrYyjFeRPBhtKleLkcF yg89JEvobEcip0HZTXtyq7fJTgD5REeEVDJPkN3O1na7rCmuf5kYVh7I65XhAktcqvDR kpEofxNAoZsERazpQ5+Bajur4Dw7vPnvHcNOJplpjohJTjSfoA5G/MPoyoDJk3gb821g x+6AvPsb/LExiFGwkFUwDWAhEqT27lep5TsNiJbNlUAvdE4tGa4oYx6vqBVdY16ffd+/ GNQA== X-Gm-Message-State: AC+VfDx54RIQhz/AiBkSLjDiAhJ3pQrrFFd2o6Y0dJseC3k69MJDK4zx bb4CMrpOadofSEJKiXRI5P0QH0FOpWdlJYKv9ho= X-Received: by 2002:a05:6808:f06:b0:398:2b60:dbf4 with SMTP id m6-20020a0568080f0600b003982b60dbf4mr15280115oiw.19.1686796833538; Wed, 14 Jun 2023 19:40:33 -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: Vincent MAILHOL Date: Thu, 15 Jun 2023 11:40:22 +0900 Message-ID: Subject: Re: [PATCH v4] Add .editorconfig file for basic formatting To: =?UTF-8?B?w43DsWlnbyBIdWd1ZXQ=?= 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: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed. 14 Jun. 2023 at 22:04, Íñigo Huguet wrote: > On Wed, Jun 14, 2023 at 2:55 PM Vincent MAILHOL wrote: > > On Wed. 14 Jun. 2023 at 20:40, Íñigo Huguet wrote: (...) > > > Right now I see 2 possibilities: > > > - Provide an .editorconfig.default so those that want to use it, can > > > do it. But I wouldn't mess with cherry-picking directories that > > > already complies and those that don't, just the developer chooses to > > > use it or not, and that's all. > > > - Provide an .editorconfig directly, and those that don't want to use > > > 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. > > > Íñigo previously stated that editors such as Kate can not opt out. I > > think that the reason is simply that no one has complained about it so > > 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=471008 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-variables.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/f9f133b6ac72dfa12bdeeab1a37c5e9dc9a9354e 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/f9f133b6ac72dfa12bdeeab1a37c5e9dc9a9354e/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? > > 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.