Sebastian Wilzbach
Sebastian Wilzbach
Just an idea - they seem to feature a lot of code analysis tools for various languages, except for D. https://codeclimate.com/engines
From `std.zlib`: ```d class Compress { import std.conv : to; private: z_stream zs; int level = Z_DEFAULT_COMPRESSION; int inited; immutable bool gzip; void error(int err) { if (inited) { deflateEnd(&zs);...
Usually using an unknown label results in compile errors and shouldn't happen, but it turns out it does: https://github.com/dlang-community/D-Scanner/pull/466 However, checking that a label is undefined goes a bit over...
``` private { int a; // [warn]: non-indented block, indent for four more characters } ```
For the `exception_check` plugin, there are the following violations in Phobos: ``` std/net/curl.d(207:20)[warn]: Catching Error or Throwable is almost always a bad idea. std/range/package.d(4368:18)[warn]: Catching Error or Throwable is almost...
A good example is `return (42);` or `(foo) ? bar : foobar` - both aren't found by Dscanner atm. For the first one, there are many example to be found...
It should be possible to check whether there are two or more lines. ``` auto a = 1; auto b = 2; ``` or: `` auto a() { } auto...
Consider this example here: ``` import std.range: iota; auto d = iota(2); d.popFront; assert(d.front == 1); ``` ``` foo.d(5:10)[warn]: Variable d is never modified and could have been declared const...
Like it is done in dmd & Phobos: See also: https://github.com/D-Programming-Language/dmd/blob/master/src/checkwhitespace.d
It is quite common in templates to name the variables after the template - as this is so prevalent in Phobos you might want to exclude templates by default. ```...