Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --ignore-codes support #251

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading