IntelliJ IDEA code format from checkstyle configuration

finally there is something: checkstyle-IDEA since 4.24.0 features import of checkstyle config. A solution is available now: Please install CheckStyle-IDEA plugin (http://plugins.jetbrains.com/plugin/1065?pr=idea), it can be found via plug-in repository (Settings|Plugins|Browse repositories). Go to Settings|Editor|Code Style, choose a code style you want to import CheckStyle configuration to. Click Manage…|Import.., choose “CheckStyle Configuration” and select a corresponding … Read more

Indenting #defines

Pre-ANSI C preprocessor did not allow for space between the start of a line and the “#” character; the leading “#” had to always be placed in the first column. Pre-ANSI C compilers are non-existent these days. Use which ever style (space before “#” or space between “#” and the identifier) you prefer. http://www.delorie.com/gnu/docs/gcc/cpp_48.html

Delphi code formatter

You can try the “Jedi code Format“. See more information here: http://jedicodeformat.sourceforge.net/ The formatting engine of DelForExp has been integrated into the code base of GExperts. An experimental version of GExperts including a “Code formatter” here: http://blog.dummzeuch.de/experimental-gexperts-version/ Separate information/downloads for DelForExp here. Regards.

How do I set up VSCode to put curly braces on a new line?

Follow the steps below to make Visual Studio Code format opening curly braces on a new line for Java Script and Type Script. In Visual Studio Code (v1.20.0) Go to File\Preferences\Settings Add the following lines in ‘User Settings‘ (in the right side pane) “javascript.format.placeOpenBraceOnNewLineForControlBlocks”: true, “javascript.format.placeOpenBraceOnNewLineForFunctions”: true, “typescript.format.placeOpenBraceOnNewLineForControlBlocks”: true, “typescript.format.placeOpenBraceOnNewLineForFunctions”: true, Save ‘User Settings‘ and … Read more

Unnecessary curly braces in C++

It’s sometimes nice since it gives you a new scope, where you can more “cleanly” declare new (automatic) variables. In C++ this is maybe not so important since you can introduce new variables anywhere, but perhaps the habit is from C, where you could not do this until C99. 🙂 Since C++ has destructors, it … Read more

How to disable code formatting for some part of the code using comments?

Since version 13 it’s possible to wrap the code with // @formatter:off … // @formatter:on IntelliJ IDEA v.2018+: File > Settings > Editor > Code Style IntelliJ IDEA v.2016+: Preferences > Editor > Code Style IntelliJ IDEA v.14+: Preferences > Editor > Code Style > Formatter Control You can change the formatter control markers, as … Read more