Skip to content

Commit

Permalink
Replace libdparse with DMD in UselessInitializerChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladiwostok committed Apr 29, 2024
1 parent 81526df commit dd1f4f9
Show file tree
Hide file tree
Showing 2 changed files with 211 additions and 275 deletions.
10 changes: 6 additions & 4 deletions src/dscanner/analysis/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -862,10 +862,6 @@ private BaseAnalyzer[] getAnalyzersForModuleAndConfig(string fileName,
checks ~= new VcallCtorChecker(args.setSkipTests(
analysisConfig.vcall_in_ctor == Check.skipTests && !ut));

if (moduleName.shouldRun!UselessInitializerChecker(analysisConfig))
checks ~= new UselessInitializerChecker(args.setSkipTests(
analysisConfig.useless_initializer == Check.skipTests && !ut));

if (moduleName.shouldRun!AllManCheck(analysisConfig))
checks ~= new AllManCheck(args.setSkipTests(
analysisConfig.allman_braces_check == Check.skipTests && !ut));
Expand Down Expand Up @@ -1350,6 +1346,12 @@ MessageSet analyzeDmd(string fileName, ASTCodegen.Module m, const char[] moduleN
config.auto_function_check == Check.skipTests && !ut
);

if (moduleName.shouldRunDmd!(UselessInitializerChecker!ASTCodegen)(config))
visitors ~= new UselessInitializerChecker!ASTCodegen(
fileName,
config.useless_initializer == Check.skipTests && !ut
);

foreach (visitor; visitors)
{
m.accept(visitor);
Expand Down
Loading

0 comments on commit dd1f4f9

Please sign in to comment.