Last week I finally released checkstyle version 2.5.0 on haxelib, over a year after version 2.4.2 came out. Despite no releases in between checkstyle development wasn’t completely dormant, there were quite a few bug fixes including some null pointer crashes in C++ builds (and other targets).
Checkstyle code was reformatted using formatter. Compatibility between formatter and checkstyle is somewhat existing, but since formatter and checkstyle use different algorithms for whitespace calculation, they are not 100% compatible. There are no plans to remove whitespace checks from checkstyle, but only very limited amount of work is going into making them fully compatible. Chances are if you use formatter, then checkstyle whitespace checks are redundant. If you really want to ensure your whitespace is formatted according to formatter rules, use formatter with --check
.
Checkstyle supports Haxe 4 code with the exception of inline (Not-)XML.
I have cleaned up command line options, because there was a bit of a mess with long and short options. Starting from 2.5.0 all long options will use --
, whereas short options use -
. So you might have to update your CI configuration, batch files or external command invocations.
I’ve added two new checks, one is BlockBreakingConditional
which will display a message whenever an unbalanced amount of curlies appear inside a conditional section e.g. #if js if (condition) { #end
.
The other is InlineFinal
which generates a message for every inline var
and suggest to change it to inline final
. InlineFinal
only makes sense for a Haxe 4 code base.
Checkstyle will try to detect nodeJS at startup (when called via haxelib run checkstyle
) and if present will launch haxecheckstyle.js via node passing on your CLI parameters. That should speed up checking your code base.
Not for 2.5.0 release but slightly after, I have changed checkstyle’s build system to use lix. So it should be a lot easier to set up a development / git version of checkstyle because lix takes care of all dependencies and makes sure you have the correct versions. With a bit of manual adjustments you can even compile checkstyle with Haxe 3, by default checkstyle uses Haxe 4rc5.
You can find documentation for checkstyle’s checks at http://haxecheckstyle.github.io/docs, please report any issues here: Issues · HaxeCheckstyle/haxe-checkstyle · GitHub
VS Code plugin for checkstyle was updated as well, make sure you have version 1.4.0 installed.