mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-26 13:20:07 +03:00
scan UDA to disable linting: handle useless_initializer check
This commit is contained in:
parent
68fd868f26
commit
b038879c22
1 changed files with 17 additions and 0 deletions
|
@ -92,7 +92,24 @@ public:
|
|||
override void visit(const(Declaration) decl)
|
||||
{
|
||||
_inStruct.insert(decl.structDeclaration !is null);
|
||||
|
||||
const msgDisabled = () {
|
||||
foreach(attr; decl.attributes)
|
||||
{
|
||||
if(this.isCheckDisabled(attr))
|
||||
{
|
||||
disableErrorMessage();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
||||
decl.accept(this);
|
||||
|
||||
if(msgDisabled)
|
||||
reenableErrorMessage();
|
||||
|
||||
if (_inStruct.length > 1 && _inStruct[$-2] && decl.constructor &&
|
||||
((decl.constructor.parameters && decl.constructor.parameters.parameters.length == 0) ||
|
||||
!decl.constructor.parameters))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue