Skip to content

Commit

Permalink
copy NeutronRuleset locally
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Jun 28, 2024
1 parent f6e9449 commit 5a85212
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
92 changes: 92 additions & 0 deletions PSR12NeutronRuleset/NeutronRuleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0"?>
<ruleset name="NeutronRuleset">
<description>Neutron Ruleset.</description>
<rule ref="VariableAnalysis"/>
<rule ref="NeutronStandard"/>
<rule ref="ImportDetection"/>
<rule ref="WordPress-Core"/>
<rule ref="Squiz.Commenting">
<severity>0</severity>
</rule>
<rule ref="ImportDetection.Imports.RequireImports">
<properties>
<property name="ignoreUnimportedSymbols" value="/^(BD_PROCESSOR_[A-Z_]+|BD_STRIPE_[A-Z_]+|BD_PAYPAL_[A-Z_]+|BD_TXN[A-Z_]+|BD_TYPE[A-Z_]+|BILLINGDADDY_HOME|require_lib|WPCOM_[A-Z_]+|tracks_record_event|BD_INTERVAL_[A-Z_]+)$/"/>
<property name="ignoreGlobalsWhenInGlobalScope" value="true"/>
<property name="ignoreWordPressSymbols" value="true"/>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.MultipleArguments">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.DocComment.SpacingBeforeTags">
<severity>0</severity>
</rule>
<rule ref="WordPress.Files.FileName">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions">
<severity>0</severity>
</rule>
<rule ref="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid">
<severity>0</severity>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned">
<severity>0</severity>
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment.NotSameWarning">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.YodaConditions.NotYoda">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace">
<severity>0</severity>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis">
<severity>0</severity>
</rule>
<rule ref="NeutronStandard.StrictTypes.RequireStrictTypes.StrictTypes">
<type>warning</type>
</rule>
<rule ref="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound">
<type>warning</type>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching">
<severity>0</severity>
</rule>
<rule ref="ImportDetection.Imports.RequireImports.Import">
<type>error</type>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable">
<type>error</type>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedCaughtExceptions" value="true"/>
</properties>
</rule>
<rule ref="WordPress.PHP.StrictInArray.MissingTrueStrict">
<type>error</type>
</rule>
<rule ref="NeutronStandard.Functions.TypeHint.NoArgumentType">
<severity>0</severity>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.DirectQuery">
<severity>0</severity>
</rule>
<rule ref="WordPress.DB.PreparedSQL.NotPrepared">
<type>warning</type>
</rule>
<rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped">
<severity>0</severity>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_var_export">
<severity>0</severity>
</rule>
<rule ref="Generic.Arrays.DisallowShortArraySyntax">
<severity>0</severity>
</rule>
</ruleset>
5 changes: 4 additions & 1 deletion PSR12NeutronRuleset/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</rule>
-->

<rule ref="NeutronRuleset">
<rule ref="./NeutronRuleset.xml">
<exclude name="Generic.Classes.OpeningBraceSameLine"/>
<exclude name="Generic.Formatting.SpaceAfterCast"/>
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
Expand Down Expand Up @@ -144,6 +144,9 @@

<!-- https://github.com/sirbrillig/phpcs-import-detection/issues/45 -->
<exclude name="ImportDetection.Imports.RequireImports"/>

<!-- Old Neutron -->
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison"/>
</rule>
<!-- WordPress-Core opposite rules -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
Expand Down

0 comments on commit 5a85212

Please sign in to comment.