Merge pull request #455 from dlang-community/issue-454
fix #454 - Ddoc for unions are not detected
This commit is contained in:
commit
18a8b6b15e
2
dub.json
2
dub.json
|
@ -10,7 +10,7 @@
|
||||||
"StdLoggerDisableWarning"
|
"StdLoggerDisableWarning"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"libdparse": "~>0.7.1-beta.2",
|
"libdparse": "~>0.7.1-beta.4",
|
||||||
"dsymbol": "~>0.2.0",
|
"dsymbol": "~>0.2.0",
|
||||||
"inifiled": ">=0.0.6",
|
"inifiled": ">=0.0.6",
|
||||||
"emsi_containers": "~>0.5.3",
|
"emsi_containers": "~>0.5.3",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit e115106395937d88947a9d7866025ff8cc93cbff
|
Subproject commit 5e81535d0aff4ceec2cbf03f5b02a31ae6d3fec2
|
|
@ -294,3 +294,44 @@ private immutable string[] ignoredFunctionNames = [
|
||||||
];
|
];
|
||||||
|
|
||||||
private enum getSetRe = ctRegex!`^(?:get|set)(?:\p{Lu}|_).*`;
|
private enum getSetRe = ctRegex!`^(?:get|set)(?:\p{Lu}|_).*`;
|
||||||
|
|
||||||
|
unittest
|
||||||
|
{
|
||||||
|
import std.stdio : stderr;
|
||||||
|
import std.format : format;
|
||||||
|
import analysis.config : StaticAnalysisConfig, Check, disabledConfig;
|
||||||
|
import analysis.helpers : assertAnalyzerWarnings;
|
||||||
|
|
||||||
|
StaticAnalysisConfig sac = disabledConfig();
|
||||||
|
sac.undocumented_declaration_check = Check.enabled;
|
||||||
|
|
||||||
|
assertAnalyzerWarnings(q{
|
||||||
|
class C{} // [warn]: Public declaration 'C' is undocumented.
|
||||||
|
interface I{} // [warn]: Public declaration 'I' is undocumented.
|
||||||
|
enum e = 0; // [warn]: Public declaration 'e' is undocumented.
|
||||||
|
void f(){} // [warn]: Public declaration 'f' is undocumented.
|
||||||
|
struct S{} // [warn]: Public declaration 'S' is undocumented.
|
||||||
|
template T(){} // [warn]: Public declaration 'T' is undocumented.
|
||||||
|
union U{} // [warn]: Public declaration 'U' is undocumented.
|
||||||
|
}, sac);
|
||||||
|
|
||||||
|
assertAnalyzerWarnings(q{
|
||||||
|
/// C
|
||||||
|
class C{}
|
||||||
|
/// I
|
||||||
|
interface I{}
|
||||||
|
/// e
|
||||||
|
enum e = 0;
|
||||||
|
/// f
|
||||||
|
void f(){}
|
||||||
|
/// S
|
||||||
|
struct S{}
|
||||||
|
/// T
|
||||||
|
template T(){}
|
||||||
|
/// U
|
||||||
|
union U{}
|
||||||
|
}, sac);
|
||||||
|
|
||||||
|
stderr.writeln("Unittest for UndocumentedDeclarationCheck passed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue