Bug 471008 - Allow to ignore editorconfig rules
Summary: Allow to ignore editorconfig rules
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: indentation (show other bugs)
Version: unspecified
Platform: Other All
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-14 06:08 UTC by Íñigo
Modified: 2023-06-17 14:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Íñigo 2023-06-14 06:08:02 UTC
Kate supports parsing .editorconfig files to apply its formatting rules. However, this happens always there is an .editorconfig file present, and it is not possible to avoid it.

Although using the rules from .editorconfig is almost always the desired behaviour, there are some cases where this is not desired and deleting the file would be uncomfortable because it's part of the repository. To name a few:
- There are contributors of the project that don't like automatic formatting and want to do the formatting manually, or with different tools
- The file is added late, when the project already has lot of developed code, but the team doesn't want it to cause massive reformatting in old files that are not touched frequently

I think it should be possible to disable using editorconfig (and maybe also kateconfig) from settings.
Comment 1 Waqar Ahmed 2023-06-14 06:32:20 UTC
While this is trivially doable and has been asked before, I don't think we will do it. The file is put in a project so that its rules are followed by the code in project.
Comment 2 Íñigo 2023-06-14 10:19:47 UTC
Maybe this is not the best reason to convince you, but anyway is an additional reason: all other editors I know with editorconfig support (or any other formatting tool) allow not to use it, either it is opt-in or opt-out, either via plugins or builtin. I'm totally favourable to the opt-out approach: editorconfig enabled by default, but user can disable it.

It's true that the file is in the project, but maybe it's not by user choice, but because it's a repo used by many people and the file is added for convenience of the developers, but not enforcing its use. User freedom should prevail, and in any case it's the project owners' responsibility to enforce the formatting rules, not the editor chosen by each developer's responsibility.
Comment 3 Waqar Ahmed 2023-06-14 10:27:53 UTC
Ok, patches are welcome. This is easy to do so if you want to try, I can help.
Comment 4 Íñigo 2023-06-14 13:13:02 UTC
If nobody else is willing to do it, I can try, but then it can take lot of time. I have almost no free time lately, and I don't know KDE framework nor I am familiar at all wit the code base nor with the process to contribute. With your help I will try, but it will be very slow.
Comment 5 Waqar Ahmed 2023-06-15 07:48:28 UTC
We have infinite time and no deadlines ;)