Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop plugin declaration inspections #588

Conversation

Iamwade
Copy link
Collaborator

@Iamwade Iamwade commented May 6, 2021

Description (*)
Added inspection to the di.xml file for plugin tag.
The inspection is performed for plugin attribute "type".
If the class in the specified path for these attributes does not exist or empty, then the corresponding warning will be displayed
image
image
image

Inspection for the class inside the main "type" tag was done in the issue #582

Fixed Issues (if relevant)

  1. Fixes Develop plugin declaration types inspections #579

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with integration/functional tests (if applicable)
  • All automated tests passed successfully (all builds are green)

}

/**
* Test for an no error for the "type" attribute because this class exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test for no error for the "type" attribute because this class exists.

Suggested change
* Test for an no error for the "type" attribute because this class exists.
* Test for no error for the "type" attribute because this class exists.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

bundle="magento2.inspection" key="inspection.displayName.PluginAttrTypeInspection"
groupBundle="magento2.inspection" groupKey="inspection.group.name"
enabledByDefault="true" level="WARNING"
implementationClass="com.magento.idea.magento2plugin.inspections.xml.PluginAttrTypeInspection"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
implementationClass="com.magento.idea.magento2plugin.inspections.xml.PluginAttrTypeInspection"/>
implementationClass="com.magento.idea.magento2plugin.inspections.xml.PluginAttributeTypeInspection"/>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import com.magento.idea.magento2plugin.magento.files.ModuleDiXml;
import org.jetbrains.annotations.NotNull;

public class PluginAttrTypeInspection extends XmlSuppressableInspectionTool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class PluginAttrTypeInspection extends XmlSuppressableInspectionTool {
public class PluginAttributeTypeInspection extends XmlSuppressableInspectionTool {

Let's avoid such a shortening.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Iamwade
Copy link
Collaborator Author

Iamwade commented May 10, 2021

@VitaliyBoyko fixed, Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop plugin declaration types inspections
3 participants