From a8f4f71c4619b4d40e08086059ee0798df47984c Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Fri, 30 Mar 2018 11:14:16 +0200 Subject: [PATCH] Ignore has_public_example for deprecated symbols --- src/dscanner/analysis/has_public_example.d | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dscanner/analysis/has_public_example.d b/src/dscanner/analysis/has_public_example.d index fa9c844..9c305fa 100644 --- a/src/dscanner/analysis/has_public_example.d +++ b/src/dscanner/analysis/has_public_example.d @@ -44,6 +44,12 @@ class HasPublicExampleCheck : BaseAnalyzer // check all public top-level declarations foreach (decl; mod.declarations) { + if (decl.attributes.any!(a => a.deprecated_ !is null)) + { + lastDecl = null; + continue; + } + if (!isPublic(decl.attributes)) { checkLastDecl(); @@ -316,6 +322,12 @@ unittest unittest {} }, sac); + // deprecated symbols shouldn't require a test + assertAnalyzerWarnings(q{ + /// + deprecated void dirName(C)(C[] path) {} + }, sac); + stderr.writeln("Unittest for HasPublicExampleCheck passed."); }