Skip to content

Adds .editorconfig file#2876

Closed
sobolevn wants to merge 1 commit into
RustPython:mainfrom
sobolevn:editorconfig
Closed

Adds .editorconfig file#2876
sobolevn wants to merge 1 commit into
RustPython:mainfrom
sobolevn:editorconfig

Conversation

@sobolevn

Copy link
Copy Markdown
Contributor

It was really bothering me that my vscode was not adding 4 spaces as the default ident.

What is editorconfig? It is a tool to standartize things like new lines, idents, and whitespaces across different editors and different OSes.
Docs: https://editorconfig.org/

@youknowone

youknowone commented Aug 13, 2021

Copy link
Copy Markdown
Member

Do you experience it even after installing RLS(Rust Language Server)? We just follow the default rule of rustfmt, so I expect that must be configured well at least after installing the plugins if there is no special settings already.

@sobolevn

Copy link
Copy Markdown
Contributor Author

I use https://github.com/rust-analyzer/rust-analyzer
Without this file it is inconvenient in the formatting part 🙂

@fanninpm

Copy link
Copy Markdown
Contributor

No real need. Just make sure "editor.formatOnSave": true is in your workspace's .vscode/settings.json, and rustfmt will take care of the rest. (Remember to turn it off when you're working within the Lib/ directory, though.)

@youknowone

Copy link
Copy Markdown
Member

I think formatOnSave is a convenient tool but not the proper solution of the wrong indentation for editing itself. I wonder why it happens. I tried a bare vscode but didn't have that problem. So now I think you have some global indent configuration in vscode.

To test a bare vscode, stroke . key in anywhere of https://github.com/RustPython/RustPython/ . it will show a web version of vscode without much things.

@youknowone

Copy link
Copy Markdown
Member

I think #2897 is a reasonable support for this PR, though it only can fix the indent problem but not formatting itself.

@youknowone youknowone closed this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants