Skip to content

Commit

Permalink
Merge pull request #818 from WordPress/696-folloup
Browse files Browse the repository at this point in the history
Preferred error type to be singular
  • Loading branch information
ernilambar authored Dec 5, 2024
2 parents f76f68a + 6b3b8af commit f7c814a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions includes/CLI/Plugin_Check_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,10 @@ private function get_filtered_results_by_severity( $results, $error_severity, $w
if ( 'ERROR' === $item['type'] && $item['severity'] >= $error_severity ) {
$errors[] = $item;
} elseif ( $include_low_severity_errors && 'ERROR' === $item['type'] && $item['severity'] < $error_severity ) {
$item['type'] = 'ERRORS_LOW_SEVERITY';
$item['type'] = 'ERROR_LOW_SEVERITY';
$errors[] = $item;
} elseif ( $include_low_severity_warnings && 'WARNING' === $item['type'] && $item['severity'] < $warning_severity ) {
$item['type'] = 'WARNINGS_LOW_SEVERITY';
$item['type'] = 'WARNING_LOW_SEVERITY';
$warnings[] = $item;
} elseif ( 'WARNING' === $item['type'] && $item['severity'] >= $warning_severity ) {
$warnings[] = $item;
Expand Down
6 changes: 3 additions & 3 deletions tests/behat/features/plugin-check-severity.feature
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ Feature: Test that the severity level in plugin check works.
"""
And STDOUT should contain:
"""
WordPress.WP.AlternativeFunctions.rand_mt_rand,ERRORS_LOW_SEVERITY,5
WordPress.WP.AlternativeFunctions.rand_mt_rand,ERROR_LOW_SEVERITY,5
"""
And STDOUT should contain:
"""
WordPress.Security.EscapeOutput.OutputNotEscaped,ERRORS_LOW_SEVERITY,5
WordPress.Security.EscapeOutput.OutputNotEscaped,ERROR_LOW_SEVERITY,5
"""

When I run the WP-CLI command `plugin check foo-bar-wp --format=csv --fields=code,type,severity --warning-severity=7 --include-low-severity-warnings`
Expand All @@ -213,7 +213,7 @@ Feature: Test that the severity level in plugin check works.
"""
And STDOUT should contain:
"""
upgrade_notice_limit,WARNINGS_LOW_SEVERITY,5
upgrade_notice_limit,WARNING_LOW_SEVERITY,5
"""
And STDOUT should contain:
"""
Expand Down

0 comments on commit f7c814a

Please sign in to comment.