nilaway
nilaway copied to clipboard
Support cross-package nolint parsing
We can report errors on pkg A
when we are analyzing pkg B
due to our multi-pkg inference. However, nogo’s support for nolint comments is based on reading the AST from current package.
That is, nogo does not know we have a nolint comment in pkg A when analyzing pkg B , but NilAway can report an error there, and hence cannot be suppressed.
The other linter implementations most likely follow the same logic.
We’ll need to implement own cross-pkg nolint support (i.e., reading the nolint and writing it to facts, then read it in downstream analysis to decide whether to report a certain error or not).