File tree Expand file tree Collapse file tree 3 files changed +22
-11
lines changed
Expand file tree Collapse file tree 3 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -411,13 +411,17 @@ public:
411411 *
412412 * When overriden, make sure to keep this structure
413413 */
414- override void visit (const (ModuleDeclaration) moduleDeclaration )
414+ override void visit (const (Module) mod )
415415 {
416- auto currNoLint = NoLintFactory.fromModuleDeclaration(moduleDeclaration);
417- noLint.push(currNoLint);
418- scope (exit) noLint.pop(currNoLint);
419-
420- moduleDeclaration.accept(this );
416+ if (mod.moduleDeclaration ! is null )
417+ {
418+ auto currNoLint = NoLintFactory.fromModuleDeclaration(mod.moduleDeclaration);
419+ noLint.push(currNoLint);
420+ scope (exit) noLint.pop(currNoLint);
421+ mod.accept(this );
422+ }
423+ else
424+ mod.accept(this );
421425 }
422426
423427 /**
Original file line number Diff line number Diff line change @@ -237,10 +237,5 @@ unittest
237237 ^^^^^^^^^^^^^^ [warn]: Function name 'WinButWithBody' does not match style guidelines. +/
238238 }c, sac);
239239
240- assertAnalyzerWarnings(q{
241- @(" nolint(dscanner.style.phobos_naming_convention)" )
242- module AMODULE ;
243- }c, sac);
244-
245240 stderr.writeln(" Unittest for StyleChecker passed." );
246241}
Original file line number Diff line number Diff line change @@ -395,6 +395,18 @@ public:
395395
396396 }, sac);
397397
398+ // passes (disable check at module level)
399+ assertAnalyzerWarnings(q{
400+ @(" nolint(dscanner.useless-initializer)" )
401+ module my_module ;
402+
403+ int a = 0 ;
404+
405+ int f () {
406+ int a = 0 ;
407+ }
408+ }, sac);
409+
398410 stderr.writeln(" Unittest for UselessInitializerChecker passed." );
399411}
400412
You can’t perform that action at this time.
0 commit comments