Skip to content

Commit

Permalink
Update severity for i18n codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Dec 24, 2024
1 parent 293710f commit fc6dd66
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions includes/Checker/Checks/General/I18n_Usage_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ protected function add_result_message_for_file( Check_Result $result, $error, $m
break;
}

// Update severity.
switch ( $code ) {
case 'WordPress.WP.I18n.InterpolatedVariableDomain':
case 'WordPress.WP.I18n.MissingArgText':
case 'WordPress.WP.I18n.NoEmptyStrings':
case 'WordPress.WP.I18n.NonSingularStringLiteralContext':
case 'WordPress.WP.I18n.NonSingularStringLiteralDomain':
case 'WordPress.WP.I18n.TooManyFunctionArgs':
$severity = 7;
break;

default:
break;
}

parent::add_result_message_for_file( $result, $error, $message, $code, $file, $line, $column, $docs, $severity );
}
}

0 comments on commit fc6dd66

Please sign in to comment.