Skip to content

Assign severity to each sniff #37

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

Merged
merged 6 commits into from
Feb 28, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Magento/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<type>warning</type>
</rule>

<!-- Severity 8 warnings: Magento specific code issues. -->
<!-- Severity 8 warnings: Magento specific code issues and design violations. -->
<rule ref="Magento.Classes.ObjectInstantiation">
<severity>8</severity>
<type>warning</type>
Expand All @@ -117,6 +117,10 @@
<severity>8</severity>
<type>warning</type>
</rule>
<rule ref="Magento.Functions.StaticFunction">
<severity>8</severity>
<type>warning</type>
</rule>
<rule ref="Magento.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
Expand Down Expand Up @@ -302,6 +306,7 @@
<rule ref="PSR2.Classes.PropertyDeclaration">
<severity>6</severity>
<type>warning</type>
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these excluded? We do not want any variables and method with underscore prefixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's because a lot of legacy code in Magento. When extension developers extend some classes they need to suppress such findings.

Copy link
Contributor

Choose a reason for hiding this comment

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

We need some strategy for the new code to enable such rules there.

</rule>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing">
<severity>6</severity>
Expand Down Expand Up @@ -336,6 +341,7 @@
<rule ref="PSR2.Methods.MethodDeclaration">
<severity>6</severity>
<type>warning</type>
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
</rule>
<rule ref="PSR2.Namespaces.NamespaceDeclaration">
<severity>6</severity>
Expand Down Expand Up @@ -398,6 +404,10 @@
<severity>6</severity>
<type>warning</type>
</rule>
<rule ref="Squiz.Operators.ValidLogicalOperators">
<severity>6</severity>
<type>warning</type>
</rule>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
<severity>6</severity>
<type>warning</type>
Expand Down