Use a fleshed out and supported coding style #2227
Replies: 5 comments
-
Here is a guide on how to use clang-format in Visual Studio: http://visualstudioextensions.vlasovstudio.com/2013/11/05/format-c-code-intelligently-in-visual-studio-with-clang-format/ |
Beta Was this translation helpful? Give feedback.
-
versable... Pavel |
Beta Was this translation helpful? Give feedback.
-
For C::B I'd use Scripting Commands (http://wiki.codeblocks.org/index.php?title=Scripting_commands)
I'm sure there is something similar in KDevelop Personally I use sublime, which has a working plugin for clang-format. |
Beta Was this translation helpful? Give feedback.
-
FWIW -- I'm going to use @versable 's idea of using
The latter two form my workaround to keep clang-format from breaking up wxT() and _() macro content too much. |
Beta Was this translation helpful? Give feedback.
-
I have been thinking the same, actually. That said, I don't really care about the actual style used as long as it is consistent. |
Beta Was this translation helpful? Give feedback.
-
As the code rarely follows the proposed style. And the style guideline is rather short (http://opencpn.org/ocpn/code-style). I would move to a well established code style that supports linters, autoformatters, IDE plugins, etc...
A great tool that I regularly use is clang-format, which formats any file I edit on the fly. ( IDE set to call clang-format on save ). It supports the following formats: LLVM, Google, Chromium, Mozilla, WebKit.
It would be a good step to make the code a bit cleaner, and the effort is minimal ( except merging current pull request would be time consuming )
Beta Was this translation helpful? Give feedback.
All reactions