Skip to content

Commit

Permalink
Merge pull request #264 from 10up/fix/issue-263-styles-pre-multiline
Browse files Browse the repository at this point in the history
Long lines of code with PHPCS check no longer expand over the size of the notice
  • Loading branch information
bordoni authored Sep 22, 2023
2 parents 3895f60 + 6820664 commit c0d3b60
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ function render_page() {
return;
}

// @todo This should be eventually moved to a separate file.
echo <<<HTML
<style>
.wp-plugin-check-code {
white-space:pre-wrap;
word-wrap:break-word;
}
.wp-plugin-check-code code {
line-height:1.7em
}
</style>
HTML;

echo '<div class="wrap">';
echo '<h1>' . esc_html__( 'Plugin Check', 'plugin-check' ) . '</h1>';
echo '<p>' . esc_html__( 'Select a plugin to run the checks against.', 'plugin-check' ) . '</p>';
Expand Down
2 changes: 1 addition & 1 deletion checks/phpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected function phpcs_result_to_warnings( $result ) {
$message['line'],
$filename,
rtrim( $message['message'], '.' ),
"<pre><code>{$source_code}</code></pre>"
"<pre class='wp-plugin-check-code'><code>{$source_code}</code></pre>"
)
);
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ This plugin checker is not perfect, and never will be. It is only a tool to help
* Fix - Ensure `readme.txt` has priority over `readme.md` when both are present. Props @bordoni, @afragen [#258](https://github.com/10up/plugin-check/pull/258)
* Fix - Ensure that the PHPCS check runs even when the PHPCS binary is not executable. Props @bordoni, @shawn-digitalpoint, @mrfoxtalbot [#254](https://github.com/10up/plugin-check/pull/254)
* Fix - Readme changes and typos. Props @aaronjorbin. [#261](https://github.com/10up/plugin-check/pull/261)
* Fix - Long lines of code with PHPCS check no longer expand over the size of the notice. Props @bordoni @felixarntz. [#263](https://github.com/10up/plugin-check/pull/263)

= [0.2.0] 2023-09-18 =

Expand Down

0 comments on commit c0d3b60

Please sign in to comment.