the-algorithm-ml icon indicating copy to clipboard operation
the-algorithm-ml copied to clipboard

Include a .editorconfig file

Open robvdl opened this issue 1 year ago • 3 comments

Twitter's source code uses a slightly unusual code style, 2 space indentiation while the Python language preference is 4.

It would be nice if a .editorconfig file was included in each repo stating to use 2 space indention for .py files as that would help IDE's and editors use the correct indentation for the project.

robvdl avatar Mar 31 '23 20:03 robvdl

This is a good idea. Don't most editors auto-detect the indentation used in a file though?

Daniel15 avatar Apr 01 '23 01:04 Daniel15

Yeah to a point but how would you detect 2 space vs 4 space? The .editorconfig format is widely used in existing projects out there (see editorconfig.org). Multilanguage projects are often more complex where you might have .js and .json using 2 space, but .py using 4 space, while other files (Go and Make just as an example) might use tabs. By including a .editorconfig file I don't really have to think so much about that.

robvdl avatar Apr 01 '23 05:04 robvdl