Avoid linting in macros, if MacroReport
is set in declare_lint
#149
Labels
A-driver
Area: Driver or something related to the internal working of a driver.
A-marker-adapter
Area: Adapter
C-enhancement
Category: New feature or request
E-help-wanted
Participation: Issues with some complexity and where help would be highly appreciated
A common pattern during linting is to check if the current code originates from a macro, and if so, abort early. This works well in most instances, but has some edge cases, where it doesn't. Mostly, proc macros, that manipulate spans for error reporting.
When I designed the initial
Lint
struct, I proposed (and by this mean, just added) aMacroReport
enum, which allows the user to directly specify how macros should be handled by lint emissions. The idea was to automate a macro handling and make it as simple as possible.So, this issue is about implementing the required functions for
MacroReport
. I'm guessing it should be enough to do so, in the adapter. It might also be possible to track the current statusInsideMacro
/UserCode
/... in theAstContext
to safe some performance for lookups.There is no tried and true methods, this requires some prototyping :)
The text was updated successfully, but these errors were encountered: