Merge pull request #576 from wilzbach/has-public-examples-deprecated
Ignore has_public_example for deprecated symbols merged-on-behalf-of: BBasile <BBasile@users.noreply.github.com>
This commit is contained in:
commit
8b52e513b9
|
@ -44,6 +44,12 @@ class HasPublicExampleCheck : BaseAnalyzer
|
||||||
// check all public top-level declarations
|
// check all public top-level declarations
|
||||||
foreach (decl; mod.declarations)
|
foreach (decl; mod.declarations)
|
||||||
{
|
{
|
||||||
|
if (decl.attributes.any!(a => a.deprecated_ !is null))
|
||||||
|
{
|
||||||
|
lastDecl = null;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isPublic(decl.attributes))
|
if (!isPublic(decl.attributes))
|
||||||
{
|
{
|
||||||
checkLastDecl();
|
checkLastDecl();
|
||||||
|
@ -316,6 +322,12 @@ unittest
|
||||||
unittest {}
|
unittest {}
|
||||||
}, sac);
|
}, sac);
|
||||||
|
|
||||||
|
// deprecated symbols shouldn't require a test
|
||||||
|
assertAnalyzerWarnings(q{
|
||||||
|
///
|
||||||
|
deprecated void dirName(C)(C[] path) {}
|
||||||
|
}, sac);
|
||||||
|
|
||||||
stderr.writeln("Unittest for HasPublicExampleCheck passed.");
|
stderr.writeln("Unittest for HasPublicExampleCheck passed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue