Skip to content

Commit

Permalink
Replace libdparse with DMD in UndocumentedDeclarationCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladiwostok committed Nov 8, 2024
1 parent f6bfa57 commit 9923e70
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 260 deletions.
4 changes: 0 additions & 4 deletions src/dscanner/analysis/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,6 @@ BaseAnalyzer[] getAnalyzersForModuleAndConfig(string fileName,
checks ~= new FunctionAttributeCheck(args.setSkipTests(
analysisConfig.function_attribute_check == Check.skipTests && !ut));

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

return checks;
}

Expand Down
7 changes: 7 additions & 0 deletions src/dscanner/analysis/rundmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import dscanner.analysis.redundant_storage_class : RedundantStorageClassCheck;
import dscanner.analysis.static_if_else : StaticIfElse;
import dscanner.analysis.style : StyleChecker;
import dscanner.analysis.trust_too_much : TrustTooMuchCheck;
import dscanner.analysis.undocumented : UndocumentedDeclarationCheck;
import dscanner.analysis.unmodified : UnmodifiedFinder;
import dscanner.analysis.unused_label : UnusedLabelCheck;
import dscanner.analysis.unused_parameter : UnusedParameterCheck;
Expand Down Expand Up @@ -339,6 +340,12 @@ MessageSet analyzeDmd(string fileName, ASTCodegen.Module m, const char[] moduleN
config.if_constraints_indent == Check.skipTests && !ut
);

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

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

0 comments on commit 9923e70

Please sign in to comment.