[issue44854] Add .editorconfig to the root directory

Łukasz Langa report at bugs.python.org
Mon Aug 9 10:25:19 EDT 2021


Łukasz Langa <lukasz at langa.pl> added the comment:

> I did not see anything in the EditorConfig guide about what happens when .editorconfig does not start with root = true and another file is found.

Good question. The docs do mention this but the information is scattered across the website. The key points are:

> EditorConfig files are read top to bottom and the most recent rules found take precedence. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence.

> When opening a file, EditorConfig plugins look for a file named .editorconfig in the directory of the opened file and in every parent directory. A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with root=true is found.

In other words, unless root=True is specified, the editor will keep looking for .editorconfig also in parent directories as well and composing the config from all files it found.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44854>
_______________________________________


More information about the Python-bugs-list mailing list