Rubberduck: IgnoreModule does not work for "Public Member name contains an underscore" inspection

Created on 21 May 2019  路  4Comments  路  Source: rubberduck-vba/Rubberduck

Rubberduck version information
Version 2.4.1.4719
OS: Microsoft Windows NT 10.0.17763.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.11629.20136
Host Executable: WINWORD.EXE

Description
As per the title. I have a number of Modules and classes with the '@IgnoreModule annotation. Where the Module is a '@TestModule, it is hidden from code inspections. Where '@IgnoreModule is in a normal Class or Module the respective Class or Module is not ignored for code inspections.

vbWatchdog generates a lot of code inspections.....

bug difficulty-02-ducky feature-annotations feature-inspections good first issue hacktoberfest up-for-grabs

Most helpful comment

I really think we should move these checks to the base class or let the results expose a property indicating whether they are ignored and filter on that in the inspection base class.

It is just too easy to forget to implement this filtering in every inspection.

All 4 comments

Following my comment on #4990 I've done a bit more investigation. It seems that there is a specific inspection which is not ignored by '@IgnoreModule'. This inspection result is the 'Public member name contains an underscore. Unfortunately, vbWatchdog seems to have a large number of this type of memeber.

Just for completeness' sake: The inspection is not only ignoring '@IgnoreModule annotations but also when we explicitly set '@Ignore UnderscoreInPublicClassModuleMember for the respective procedure.

(And yes, I've also stumbled upon this due to vbWatchdog.) :)

This should be pretty straightforward. We only need to check whether the inspection result is isngored for the module or member within the inspection.

Something like the following needs to be put into the inspection. https://github.com/rubberduck-vba/Rubberduck/blob/0db534ed9b63f4ff84b36baf3ae9ad89b1749486/Rubberduck.CodeAnalysis/Inspections/Concrete/AssignmentNotUsedInspection.cs#L73-L78

I really think we should move these checks to the base class or let the results expose a property indicating whether they are ignored and filter on that in the inspection base class.

It is just too easy to forget to implement this filtering in every inspection.

Was this page helpful?
0 / 5 - 0 ratings