Einzelnen Beitrag anzeigen

Roman Yankovsky

Registriert seit: 18. Feb 2015
 
#45

AW: Neuer FixInsight ist da!

  Alt 26. Mär 2015, 13:22
Regarding excluding code from being checked, you mean like this?
Take this:
Yes, exactly like this.

Regarding your second question about ignoring only a specific warning Stefan is right, it's not a trivial task. I'm thinking about implementing this though.

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.
I was thinking about something like this:
Delphi-Quellcode:
{$FIOFF W509}
procedure Method;
begin

end;
{$FION W509}
It's still not trivial, but I think I can handle this directives in DelphiAST by adding a certan attribute to all syntax nodes between $FIOFF and $FION. Not in DelphiAST itself of course, but it is possible to inherit it and override a few methods. And as you have mentioned above, attributes is another option.
  Mit Zitat antworten Zitat