Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (22 sloc)
989 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: Get artifacts that are extention classes but don't have a prefix :) | |
(: @Language Xpp :) | |
<Diagnostics Category='Mandatory' href='docs.microsoft.com/Socratex/ExtensionsWithoutPrefix' Version='1.0'> | |
{ | |
for $a in /Class | |
where $a/AttributeList/Attribute[@Name = "ExtensionOf"] | |
let $targetClass := $a/AttributeList/Attribute[@Name = "ExtensionOf"]/AttributeExpression/IntrinsicAttributeLiteral[@FunctionName = "classStr"]/string(@Arg1) | |
where $a/@Name = fn:concat($targetClass, "_Extension") | |
return | |
<Diagnostic> | |
<Moniker>ExtensionsWithoutPrefix</Moniker> | |
<Severity>Error</Severity> | |
<Path>{string($a/@PathPrefix)}</Path> | |
<Message>Extension class name should include a prefix</Message> | |
<DiagnosticType>AppChecker</DiagnosticType> | |
<Line>{string($a/@StartLine)}</Line> | |
<Column>{string($a/@StartCol)}</Column> | |
<EndLine>{string($a/@EndLine)}</EndLine> | |
<EndColumn>{string($a/@EndCol)}</EndColumn> | |
</Diagnostic> | |
} | |
</Diagnostics> |