Skip to content

Commit

Permalink
Add --ignore-codes support (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Jan 27, 2025
1 parent 6e64c42 commit 2ef3038
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ See [action.yml](action.yml)
# Default: ''
exclude-checks: ''

# List of error codes to ignore.
# Each error code should be separated with new lines.
# Examples: textdomain_mismatch, WordPress.Security.EscapeOutput.OutputNotEscaped.
#
# Default: ''
ignore-codes: ''

# List of categories to limit checks to.
# Each category should be separated with new lines.
# Examples: general, security
Expand Down
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: 'Exclude certain directories from checks'
required: false
default: ''
ignore-codes:
description: 'Error codes to ignore'
required: false
default: ''
ignore-warnings:
description: 'Ignore warnings'
required: false
Expand Down Expand Up @@ -115,7 +119,8 @@ runs:
CATEGORIES="${CATEGORIES//$'\n'/,}"
EXCLUDE_FILES="${EXCLUDE_FILES//$'\n'/,}"
EXCLUDE_DIRS="${EXCLUDE_DIRS//$'\n'/,}"
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"
IGNORE_CODES="${IGNORE_CODES//$'\n'/,}"
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"
echo "::group::Debugging information"
wp-env run cli wp cli info
Expand Down Expand Up @@ -151,6 +156,7 @@ runs:
CATEGORIES: ${{ inputs.categories && format('--categories={0}', inputs.categories) || '' }}
EXCLUDE_FILES: ${{ inputs.exclude-files && format('--exclude-files={0}', inputs.exclude-files) || '' }}
EXCLUDE_DIRS: ${{ inputs.exclude-directories && format('--exclude-directories={0}', inputs.exclude-directories) || '' }}
IGNORE_CODES: ${{ inputs.ignore-codes && format('--ignore-codes={0}', inputs.ignore-codes) || '' }}
IGNORE_WARNINGS: ${{ inputs.ignore-warnings == 'true' && '--ignore-warnings' || '' }}
IGNORE_ERRORS: ${{ inputs.ignore-errors == 'true' && '--ignore-errors' || '' }}
INCLUDE_EXPERIMENTAL: ${{ inputs.include-experimental == 'true' && '--include-experimental' || '' }}
Expand Down

0 comments on commit 2ef3038

Please sign in to comment.