Can we somehow configure `kotlinc` (using Gradle D...
# compiler
j
Can we somehow configure
kotlinc
(using Gradle DSL or compiler flag) to fail the build on unused variables/parameters/private functions (i.e. code that is 100% dead)? I only found
allWarningsAsError
but I don't want to make all warnings fail the build
y
AFK, but there's warning customization now, which lets you set specific warnings as errors. Just find the name for the warnings, and set the apt compiler flag
d
The compiler is able to report
UNUSED_EXPRESSION
,
UNUSED_ANONYMOUS_PARAMETER
and
UNUSED_LAMBDA_EXPRESSION
(these are names of diagnostics in the compiler suitable for
-Xwarning-level
CLI argument). All other warnings about unused declarations come from IDE, not the compiler.