Skip to content

Commit 2ef3038

Browse files
authored
Add --ignore-codes support (#251)
1 parent 6e64c42 commit 2ef3038

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ See [action.yml](action.yml)
4545
# Default: ''
4646
exclude-checks: ''
4747

48+
# List of error codes to ignore.
49+
# Each error code should be separated with new lines.
50+
# Examples: textdomain_mismatch, WordPress.Security.EscapeOutput.OutputNotEscaped.
51+
#
52+
# Default: ''
53+
ignore-codes: ''
54+
4855
# List of categories to limit checks to.
4956
# Each category should be separated with new lines.
5057
# Examples: general, security

action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ inputs:
3333
description: 'Exclude certain directories from checks'
3434
required: false
3535
default: ''
36+
ignore-codes:
37+
description: 'Error codes to ignore'
38+
required: false
39+
default: ''
3640
ignore-warnings:
3741
description: 'Ignore warnings'
3842
required: false
@@ -115,7 +119,8 @@ runs:
115119
CATEGORIES="${CATEGORIES//$'\n'/,}"
116120
EXCLUDE_FILES="${EXCLUDE_FILES//$'\n'/,}"
117121
EXCLUDE_DIRS="${EXCLUDE_DIRS//$'\n'/,}"
118-
ADDITIONAL_ARGS="$CHECKS $EXCLUDE_CHECKS $CATEGORIES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL $EXCLUDE_FILES $EXCLUDE_DIRS $SEVERITY $ERROR_SEVERITY $WARNING_SEVERITY $INCLUDE_LOW_SEVERITY_ERRORS $INCLUDE_LOW_SEVERITY_WARNINGS $SLUG"
122+
IGNORE_CODES="${IGNORE_CODES//$'\n'/,}"
123+
ADDITIONAL_ARGS="$CHECKS $EXCLUDE_CHECKS $CATEGORIES $IGNORE_CODES $IGNORE_WARNINGS $IGNORE_ERRORS $INCLUDE_EXPERIMENTAL $EXCLUDE_FILES $EXCLUDE_DIRS $SEVERITY $ERROR_SEVERITY $WARNING_SEVERITY $INCLUDE_LOW_SEVERITY_ERRORS $INCLUDE_LOW_SEVERITY_WARNINGS $SLUG"
119124
120125
echo "::group::Debugging information"
121126
wp-env run cli wp cli info
@@ -151,6 +156,7 @@ runs:
151156
CATEGORIES: ${{ inputs.categories && format('--categories={0}', inputs.categories) || '' }}
152157
EXCLUDE_FILES: ${{ inputs.exclude-files && format('--exclude-files={0}', inputs.exclude-files) || '' }}
153158
EXCLUDE_DIRS: ${{ inputs.exclude-directories && format('--exclude-directories={0}', inputs.exclude-directories) || '' }}
159+
IGNORE_CODES: ${{ inputs.ignore-codes && format('--ignore-codes={0}', inputs.ignore-codes) || '' }}
154160
IGNORE_WARNINGS: ${{ inputs.ignore-warnings == 'true' && '--ignore-warnings' || '' }}
155161
IGNORE_ERRORS: ${{ inputs.ignore-errors == 'true' && '--ignore-errors' || '' }}
156162
INCLUDE_EXPERIMENTAL: ${{ inputs.include-experimental == 'true' && '--include-experimental' || '' }}

0 commit comments

Comments
 (0)