Skip to content

Commit 9a2b478

Browse files
authored
Merge pull request #5 from YouweGit/feature/compatibility-phtml
Add phpcs of Magento 2 coding standards to youwe coding standards for…
2 parents aed5868 + bc9e578 commit 9a2b478

File tree

2 files changed

+5
-66
lines changed

2 files changed

+5
-66
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 2.1.0
8+
### Changed
9+
- Youwe ruleset will not check .phtml files anymore and only uses the Magento2 coding standards to check files on `phpcs`.
10+
711
## 2.0.0
812
### Added
913
- Composer package youwe/coding-standard which is now included in the Youwe coding standards for Magento 2.

Diff for: src/YouweMagento2/ruleset.xml

+1-66
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing" />
2727
<!-- Magento 2 still does not strict type arguments of functions. This is why this rule is excluded. -->
2828
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing" />
29+
<exclude-pattern>*.phtml</exclude-pattern>
2930
</rule>
3031

3132
<!-- Import most rules from official Magento2 coding standard -->
@@ -39,75 +40,9 @@
3940
<exclude name="Magento2.Commenting.ClassPropertyPHPDocFormatting" />
4041
</rule>
4142

42-
<!-- Detects function that use a for-loops call in their function. -->
43-
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed">
44-
<exclude-pattern>*.phtml</exclude-pattern>
45-
</rule>
46-
47-
<rule ref="Generic.Commenting.DocComment">
48-
<!-- default Magento 2 templates also not cohere to this. -->
49-
<exclude-pattern>*.phtml</exclude-pattern>
50-
</rule>
51-
52-
<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
53-
<!-- Magento 2 templates do not cohere to this rule. -->
54-
<exclude-pattern>*.phtml</exclude-pattern>
55-
</rule>
56-
57-
<rule ref="Generic.Files.LineLength.TooLong">
58-
<!-- Magento 2 phtml & xml both have long lines think of checkout_index_index.xml -->
59-
<exclude-pattern>*.phtml</exclude-pattern>
60-
<exclude-pattern>*.xml</exclude-pattern>
61-
</rule>
62-
63-
<rule ref="PEAR.Functions.FunctionCallSignature">
64-
<!-- default Magento 2 templates also not cohere to this. -->
65-
<exclude-pattern>*.phtml</exclude-pattern>
66-
</rule>
67-
68-
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
69-
<!-- In some cases Magento 2 still uses underscores for their properties. -->
70-
<exclude-pattern>*.phtml</exclude-pattern>
71-
</rule>
72-
73-
<rule ref="PSR2.ControlStructures.ControlStructureSpacing">
74-
<!-- default Magento 2 templates also not cohere to this. -->
75-
<exclude-pattern>*.phtml</exclude-pattern>
76-
</rule>
77-
78-
<rule ref="PSR12.ControlStructures.ControlStructureSpacing">
79-
<!-- default Magento 2 templates also not cohere to this. -->
80-
<exclude-pattern>*.phtml</exclude-pattern>
81-
</rule>
82-
83-
<rule ref="PSR12.Files.FileHeader.SpacingAfterBlock">
84-
<!-- default Magento 2 templates also not cohere to this. -->
85-
<exclude-pattern>*.phtml</exclude-pattern>
86-
</rule>
87-
88-
<rule ref="PSR12.Operators.OperatorSpacing">
89-
<!-- default Magento 2 templates also not cohere to this. -->
90-
<exclude-pattern>*.phtml</exclude-pattern>
91-
</rule>
92-
93-
<rule ref="Squiz.ControlStructures.ControlSignature">
94-
<!-- Magento 2 uses a different notation for patterns like do { / if { for phtml that's why this was excluded. -->
95-
<exclude-pattern>*.phtml</exclude-pattern>
96-
</rule>
97-
98-
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing">
99-
<!-- default Magento 2 templates also not cohere to this. -->
100-
<exclude-pattern>*.phtml</exclude-pattern>
101-
</rule>
102-
10343
<rule ref="Squiz.WhiteSpace.MemberVarSpacing" >
10444
<properties>
10545
<property name="spacingBeforeFirst" value="0"/>
10646
</properties>
10747
</rule>
108-
109-
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace">
110-
<!-- Magento 2 phptml files end differently and use endif; for example. -->
111-
<exclude-pattern>*.phtml</exclude-pattern>
112-
</rule>
11348
</ruleset>

0 commit comments

Comments
 (0)