Open taimoorgit opened 8 months ago
@moogacs I have a branch locally on my machine where I have mostly fixed this problem - I am at the point where I can set flags like --pretty-print
or --include-pkgs
and they will be obeyed properly.
The downside is that golangci-lint throws an error message and exits with a non-zero code despite running nilaway and other linters just fine.
Will report back in a couple days when I get that PR ready.
Steps to reproduce
golangci-lint run --disable-all -E nilaway
pretty-print
is not actually disabled.--include-pkgs
won't work etiher.Reason
This is happening because the config isn't read by the plugin.New()
Part of the solution is to take this
conf any
and turn it into amap[string]any
, then read key value pairs from there and feed them into the analyzer flag sets. However, it's more complicated than that.nilaway has a multi-tiered architecture, where the config needs to actually be read by a separate analyzer that all analyzers are dependent on, called 'nilaway_config'
Reference
Solution
We need to also build nilaway_analyzer.so somehow.
The YAML config will need to look more like: