Skip to content

Commit

Permalink
Replace libdparse with DMD in UnmodifiedFinder (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladiwostok authored Aug 6, 2024
1 parent 27b85c3 commit 4bf91f8
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 265 deletions.
10 changes: 6 additions & 4 deletions src/dscanner/analysis/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,6 @@ private BaseAnalyzer[] getAnalyzersForModuleAndConfig(string fileName,
moduleScope
);

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

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

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

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

0 comments on commit 4bf91f8

Please sign in to comment.