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

Strip tags in CLI output #560

Merged
merged 2 commits into from
Aug 2, 2024
Merged

Strip tags in CLI output #560

merged 2 commits into from
Aug 2, 2024

Conversation

swissspidy
Copy link
Member

Follow-up to #557

@swissspidy swissspidy added the [Type] Enhancement A suggestion for improvement of an existing feature label Aug 1, 2024
Copy link

github-actions bot commented Aug 1, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: swissspidy <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: davidperezgar <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good. Pre-approved. Left one feedback for your consideration.

@@ -522,6 +522,7 @@ private function flatten_file_results( $file_errors, $file_warnings ) {
foreach ( $column_errors as $column_error ) {

$column_error['message'] = str_replace( '<br>', "\n", $column_error['message'] );
$column_error['message'] = wp_strip_all_tags( $column_error['message'] );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Table(default) format

FILE: readme.txt

line column type code message docs
0 0 ERROR outdated_tested_upto_header Tested up to: 6.5 < 6.6. The "Tested up to" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress. https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information
Json format

FILE: readme.txt

[{"line":0,"column":0,"type":"ERROR","code":"outdated_tested_upto_header","message":"Tested up to: 6.5 < 6.6.\nThe \"Tested up to\" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.","docs":"https:\/\/developer.wordpress.org\/plugins\/wordpress-org\/how-your-readme-txt-works\/#readme-header-information"}]
CSV format ``` FILE: readme.txt line,column,type,code,message,docs 0,0,ERROR,outdated_tested_upto_header,"Tested up to: 6.5 < 6.6. The ""Tested up to"" value in your plugin is not set to the current version of WordPress. This means your plugin will not show up in searches, as we require plugins to be compatible and documented as tested up to the most recent version of WordPress.",https://developer.wordpress.org/plugins/wordpress-org/how-your-readme-txt-works/#readme-header-information ```

Not blocker: The JSON format didn't remove \n as it will exclude it if we pass second perameter as true in wp_strip_all_tags().

Copy link
Member

@davidperezgar davidperezgar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works smoothly! Tested!

@swissspidy swissspidy merged commit dcb73f0 into trunk Aug 2, 2024
24 checks passed
@swissspidy swissspidy deleted the fix/followup branch August 2, 2024 11:56
@swissspidy swissspidy added this to the 1.1.0 milestone Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants