Open 96fca67a-c7e4-47a5-b9c7-b7489d0c6f76 opened 3 years ago
I think generally as an idea this is pretty good, I guess perhaps to begin with it might be nice to have a .editorconfig to .clang-format converter
That is something that could be developed as a standalone. (great little starter project for someone!)
There are likely aspects of .editorconfig which clang-format doesn't support
But probably it would be good to take a deeper look at where these is overlap and where there isn't
its might open up new avenues for new functionality to be added to clang-format.
Yes. It solves few issues with the current approach: Well known file. All editors today understand editorconfig but not clang-format. By understand I mean highlighting or visual editing.
Filtering rules: Today you must do it externally by calling or not calling clang-format for needed files.
Forward compatibility: Today if you specify option from future clang-format fails. Editorconfig format requires you to not fail in such case.
To be clear, the feature request is that you would like clang-format to support parsing .editorconfig files directly as an alternative to .clang-format files?
Here are C++ formatting rules understood by ReSharper C++:
https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBlankLinesPageScheme.html
Here are C++ formatting rules that Visual Studio understands: https://docs.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2019
Extended Description
.editorconfig ( https://editorconfig.org/ ) is the standard way to define code formatting and analysis rules.
The main advantage of editorconfig file is filtering options which are unavailable in Clang Format YAML.
The conversion from YAML to editorconfig can be done straight-forward, for example:
.clang-format:
.editorconfig: