Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (23 sloc) 1.01 KB
(: Get artifacts that are extention classes but don't have a prefix :)
(: @Language Xpp :)
(: @Author bertd@microsoft.com :)
<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>
You can’t perform that action at this time.