Right now nMigen has an extremely simple linter that is also kind of hacky: it lets the first line of a file to contain a # nmigen: magic comment, and this comment allows disabling the UnusedElaboratable warning, mostly to allow creating elaboratables in tests just for their Python interface (i.e. without ever elaborating them). Issues like #404 would benefit from having a more well-defined linter interface.
This interface should allow:
enabling/disabling lints in file scope,
enabling/disabling lints in a scope delimited by the with statement,
Although not required, I think that it might be nice to copy Rust's #[allow]/#[warn]/#[deny] system, since it seems to work well for them, and I expect that nMigen users will request a way to make lints into hard errors in the future.
The text was updated successfully, but these errors were encountered:
an additional concern is that there should be an API to disable linter features without requiring the python source file of the caller to be accessible, this is needed if using nmigen from some other programming language through CPython's C API.