-
Notifications
You must be signed in to change notification settings - Fork 59
Add dedicated wp i18n audit command with JSON and GitHub Actions output formats
#459
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
wp i18n audit command with JSON and GitHub Actions output formats
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This comment was marked as resolved.
This comment was marked as resolved.
…lication Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…f text domain Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…unquoted strings Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
…eme detection Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… with parent class Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Implementation of
wp i18n auditcommand - Complete ✅Latest Updates
Fixed FileDataExtractor data access:
['value']key from FileDataExtractor data['value' => ..., 'line' => ...]Code refactoring for better readability:
array_map+array_uniqueinstead ofarray_filterwith side effectsCode cleanup:
preg_replacecall that stripped quotes from strings, as the gettext library already provides unquoted strings via$translation->getOriginal()Fixed
--ignore-domainflag handling:--ignore-domainis used, domain is now properly left unset to extract all strings regardless of text domainwp i18n make-pot --ignore-domainSuppressed informational messages in non-plaintext formats:
--format=jsonor--format=github-actions, the command now only outputs the formatted dataMajor Refactoring (addressing code review feedback)
Refactored AuditCommand to extend MakePotCommand instead of duplicating code:
FileDataExtractor::get_file_type(),FileDataExtractor::find_main_file())Key Changes
Refactored AuditCommand class (
src/AuditCommand.php):MakePotCommandto reuse string extraction logicget_main_file_data()to conditionally suppress log messages based on format--ignore-domainflag to extract all strings['value']keyfile:line: messageformat with informational messages (addressing File name BEFORE the Warning & full path #119)get_comment_text()to reduce code duplicationCommand registration (
i18n-command.php): UnchangedTest coverage (
features/audit.feature): All tests now passingAudit Checks Implemented
Backward Compatibility
✅ The existing audit functionality in
wp i18n make-potremains completely unchanged.Code Quality Improvements
--ignore-domainflag handlingOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.