Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .editorconfig file #889

Merged
merged 2 commits into from
Dec 15, 2021
Merged

Conversation

okalachev
Copy link
Contributor

@okalachev okalachev commented Dec 10, 2021

EditorConfig file allows IDEs (like VSCode) to use correct indentation settings without configuration.

As for me, I'm strongly for using tabs in C/C++ for indentation (reasons: https://habr.com/ru/post/118208/). But if the project is using spaces already and doesn't plan to switch to tabs, it would be much more convenient to setup VSCode automatically for all new and existing files (instead of switching to spaces manually, like I had to do now).

Note: not all the project file comply with insert_final_newline rule for now.

@aprosvetova
Copy link
Contributor

We use clang-format. It’d be pain in the ass to keep multiple configurations in sync.

There is also a clang-format VS Code plugin that loads the config file and uses it to reformat files on every save.

Could you please try installing the clang-format plugin?

@okalachev
Copy link
Contributor Author

okalachev commented Dec 10, 2021

These are about different things.

EditorConfig is very basic and about initial code editor settings with you open any file in a project. It's actually mostly about spaces/tabs setting. It works almost in all the code editors without any plugins (even on GitHub site when viewing the code!).

clang-format is about complex C++ code formatting rules. it works when you hit 'format code' and requires plugins.

EditorConfig is a really popular file and doesn't conflict with clang-format.

@aprosvetova
Copy link
Contributor

Well, I see your point. It might be easy enough to keep this file updated and in sync with the clang-format rules.

@skotopes
Copy link
Member

Do I understand right that VSCode, SublimeText, Vim doesn't support this config without plugins?
What editors do support it?

@okalachev
Copy link
Contributor Author

VSCode support without plugins was my error. The list of editors supporting without plugins: https://editorconfig.org/#pre-installed.

@skotopes skotopes merged commit f6db5dd into flipperdevices:dev Dec 15, 2021
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.

None yet

3 participants