Skip to content

Commit 2355959

Browse files
authored
Fix to strict rules and exclude pattern uses (#13)
* Fix Exclude pattern, the patterns did not include the dot of the extension allowing matching with the pathname (which for example in DDEV will match with `html` in `/var/www/html`) * Included more rules to exclude for (p)html and xml files. Indentation, line-length are very hard to fix consistently and prevents usage of component libraries (as for example with Hyvä)
1 parent 30e96bb commit 2355959

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ 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.2.1
8+
## Fixed
9+
- Exclude pattern, the patterns did not include the dot of the extension allowing matching with the pathname (which for example in DDEV will match with `html` in `/var/www/html`)
10+
## Changed
11+
- Included more rules to exclude for (p)html and xml files. Indentation, line-length are very hard to fix consistently and prevents usage of component libraries (as for example with Hyvä)
12+
713
## 2.2.0
814
## Changed
915
- Apply more rules to .html and .phtml files. In previous updates (see pull requests [#5] and [#10]), we excluded these files very widely; this change makes the exclusion more specific and intentional.

src/YouweMagento2/ruleset.xml

+24-13
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,28 @@
6060
which are in both standards.
6161
And XML files are excluded here too.
6262
-->
63-
<rule ref="Generic.Commenting.DocComment"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
64-
<rule ref="Generic.PHP.DisallowAlternativePHPTags"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
65-
<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
66-
<rule ref="PSR12.ControlStructures.ControlStructureSpacing"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
67-
<rule ref="PSR12.Files.DeclareStatement"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
68-
<rule ref="PSR12.Files.FileHeader"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
69-
<rule ref="PSR12.Traits.UseDeclaration"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
70-
<rule ref="Squiz.Arrays.ArrayDeclaration"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
71-
<rule ref="Squiz.Commenting.FunctionComment"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
72-
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
73-
<rule ref="Squiz.Commenting.VariableComment"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
74-
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
75-
<rule ref="Squiz.WhiteSpace.FunctionSpacing"><exclude-pattern>*.(x|p?ht)ml$</exclude-pattern></rule>
63+
<rule ref="Generic.Commenting.DocComment"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
64+
<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
65+
<rule ref="Generic.Files.LineLength.TooLong"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
66+
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
67+
<rule ref="Generic.PHP.DisallowAlternativePHPTags"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
68+
<rule ref="Generic.WhiteSpace.ScopeIndent.Incorrect"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
69+
<rule ref="Generic.WhiteSpace.ScopeIndent.IncorrectExact"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
70+
<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
71+
<rule ref="PSR12.ControlStructures.ControlStructureSpacing"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
72+
<rule ref="PSR12.Files.DeclareStatement"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
73+
<rule ref="PSR12.Files.FileHeader"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
74+
<rule ref="PSR12.Traits.UseDeclaration"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
75+
<rule ref="PSR2.Methods.FunctionCallSignature.CloseBracketLine"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
76+
<rule ref="PSR2.Methods.FunctionCallSignature.ContentAfterOpenBracket"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
77+
<rule ref="PSR2.Methods.FunctionCallSignature.Indent"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
78+
<rule ref="PSR2.Methods.FunctionCallSignature.MultipleArguments"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
79+
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
80+
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
81+
<rule ref="Squiz.Arrays.ArrayDeclaration"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
82+
<rule ref="Squiz.Commenting.FunctionComment"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
83+
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
84+
<rule ref="Squiz.Commenting.VariableComment"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
85+
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
86+
<rule ref="Squiz.WhiteSpace.FunctionSpacing"><exclude-pattern>\.(x|p?ht)ml$</exclude-pattern></rule>
7687
</ruleset>

0 commit comments

Comments
 (0)