Skip to content

Commit

Permalink
Add comments to the new rules in the phpcs file
Browse files Browse the repository at this point in the history
  • Loading branch information
ingeniumed committed Jun 26, 2024
1 parent b4aff7c commit a365a12
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,30 @@
<!-- Do not enforce 'class-' prefix -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />

<!-- Allow short ternaries -->
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />

<!-- These are for legacy reasons, as EditFlow's main file cannot be altered -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed" />
<exclude name="PEAR.NamingConventions.ValidClassName.StartWithCapital" />
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" />

<!-- Allow short ternaries -->
<exclude name="WordPress.PHP.DisallowShortTernary.Found" />

<!-- Allow not returning after the setup theme filter for now -->
<exclude name="WordPressVIPMinimum.Hooks.AlwaysReturnInFilter.MissingReturnStatement" />

<!-- Generates too many false positives -->
<exclude name="WordPress.WP.CapitalPDangit.Misspelled" />
<!-- We use trigger_error extensively -->
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" />

<!-- Localization is done in a legacy manner in some places, and its ben left as is for now -->
<exclude name="WordPress.WP.I18n.InterpolatedVariableSingular" />
<exclude name="WordPress.WP.I18n.InterpolatedVariablePlural" />
<exclude name="WordPress.WP.I18n.MissingSingularPlaceholder" />
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText" />

<!-- This rule is hard to solve given the heavy use of JS in the PHP code right now -->
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" />
</rule>

Expand Down

0 comments on commit a365a12

Please sign in to comment.