Einzelnen Beitrag anzeigen

Benutzerbild von Stevie
Stevie

Registriert seit: 12. Aug 2003
Ort: Soest
4.008 Beiträge
 
Delphi 10.1 Berlin Enterprise
 
#42

AW: Neuer FixInsight ist da!

  Alt 26. Mär 2015, 11:36
Do you think it would also be possible to further specify which warning or convention to ignore? In this case, I'd only like to ignore a W519 but lose all the other cool warnings and conventions as well.
Given how DelphiAST works I think that is not so trivial. The trick with the $IFNDEF just works because it ignores that part of code because the define is set by FixInsight.
For using the same technique it would require multiple parses for each rule or including ifdefs into the AST which currently is not the case.

A different approach could be like rule suppressions in StyleCop work.
But using attributes for such purpose will lead to W1025 when compiling that code unless you add a unit with dummy attributes.

Edit: Ok, maybe a combination of both could work... something like this:

Delphi-Quellcode:
{$IFDEF _FIXINSIGHT_}[SuppressRule(W519)]{$ENDIF}
procedure TChild.someVirtualMethod();
begin
   // No quack at all
end;
Stefan
“Simplicity, carried to the extreme, becomes elegance.” Jon Franklin

Delphi Sorcery - DSharp - Spring4D - TestInsight

Geändert von Stevie (26. Mär 2015 um 11:43 Uhr)
  Mit Zitat antworten Zitat