Commit a64c7861 authored by Yann Cébron's avatar Yann Cébron
Browse files

IDEA-211126 Bundled plugins: highlight vendor "email" and "url"

parent 431a7396
Showing with 19 additions and 1 deletion
+19 -1
......@@ -147,6 +147,8 @@ inspections.group.name=Plugin DevKit
inspections.plugin.xml.inner.class.must.be.separated.with.dollar=Inner class must be separated with '$'
inspections.plugin.xml.plugin.should.have.jetbrains.vendor=Plugin developed as a part of IntelliJ IDEA project should specify 'JetBrains' as its vendor
inspections.plugin.xml.plugin.should.include.jetbrains.vendor=Plugin developed as a part of IntelliJ IDEA project should include 'JetBrains' as one of its vendors
inspections.plugin.xml.plugin.jetbrains.vendor.no.url=Plugin developed as a part of IntelliJ IDEA project shouldn''t specify ''{0}'' as url
inspections.plugin.xml.plugin.jetbrains.vendor.no.email=Plugin developed as a part of IntelliJ IDEA project shouldn't specify email
inspections.plugin.xml.ep.doesnt.have.with=<extensionPoint> does not have <with> tags to specify the types of class fields
inspections.plugin.xml.ep.both.beanClass.and.interface=<extensionPoint> must not specify both 'interface' and 'beanClass' attributes
inspections.plugin.xml.ep.missing.beanClass.and.interface=<extensionPoint> must specify either 'interface' or 'beanClass' attribute
......
......@@ -300,6 +300,20 @@ public class PluginXmlDomInspection extends BasicDomElementsInspection<IdeaPlugi
else if (!PluginManagerMain.isDevelopedByJetBrains(vendor.getValue())) {
holder.createProblem(vendor, DevKitBundle.message("inspections.plugin.xml.plugin.should.include.jetbrains.vendor"));
}
else {
final String url = vendor.getUrl().getStringValue();
if (url != null && StringUtil.endsWith(url, "jetbrains.com")) {
holder.createProblem(vendor.getUrl(),
DevKitBundle.message("inspections.plugin.xml.plugin.jetbrains.vendor.no.url", url),
new RemoveDomElementQuickFix(vendor.getUrl())).highlightWholeElement();
}
}
if (DomUtil.hasXml(vendor.getEmail())) {
holder.createProblem(vendor.getEmail(),
DevKitBundle.message("inspections.plugin.xml.plugin.jetbrains.vendor.no.email"),
new RemoveDomElementQuickFix(vendor.getEmail())).highlightWholeElement();
}
}
private static void checkPluginIcon(IdeaPlugin ideaPlugin, DomElementAnnotationHolder holder, Module module) {
......
<idea-plugin>
<id>test</id>
<version>1.0</version>
<vendor>JetBrains</vendor>
<vendor <error descr="Plugin developed as a part of IntelliJ IDEA project shouldn't specify 'http://www.jetbrains.com' as url">url="http://www.jetbrains.com"</error>
<error descr="Plugin developed as a part of IntelliJ IDEA project shouldn't specify email">email="some@one.com"</error>
>JetBrains</vendor>
</idea-plugin>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment