From c617c70d465c9ca4ff307ddee441d02fa703827f Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Wed, 22 Jun 2022 17:00:33 +1200 Subject: [PATCH] Analyzer: Remove check for hook without description (#33528) Remove check for hook without description --- tools/code-analyzer/src/commands/analyzer/index.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/code-analyzer/src/commands/analyzer/index.ts b/tools/code-analyzer/src/commands/analyzer/index.ts index b42cc9b59dc..725e0802781 100644 --- a/tools/code-analyzer/src/commands/analyzer/index.ts +++ b/tools/code-analyzer/src/commands/analyzer/index.ts @@ -274,7 +274,8 @@ export default class Analyzer extends Command { return null; } - const updateFunctionRegex = /\+{1,2}\s*'(\d.\d.\d)' => array\(\n\+{1,2}\s*'(.*)',\n\+{1,2}\s*\),/m; + const updateFunctionRegex = + /\+{1,2}\s*'(\d.\d.\d)' => array\(\n\+{1,2}\s*'(.*)',\n\+{1,2}\s*\),/m; const match = databaseUpdatePatch.match( updateFunctionRegex ); if ( ! match ) { @@ -376,19 +377,12 @@ export default class Analyzer extends Command { for ( const p in patches ) { const patch = patches[ p ]; const results = patch.match( newRegEx ); - const hasHookRegex = /apply_filters|do_action/g; - const hasHook = patch.match( hasHookRegex ); const hooksList: Map< string, string[] > = new Map< string, string[] >(); if ( ! results ) { - if ( hasHook ) { - this.error( - 'A hook has been introduced or updated without a docBlock. Please add a docBlock.' - ); - } continue; }