Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Arntz <[email protected]>
  • Loading branch information
mukeshpanchal27 and felixarntz authored Aug 2, 2023
1 parent dedd95e commit a21ea17
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions includes/Checker/Checks/Plugin_Readme_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,10 @@ private function check_default_text( Check_Result $result, array $files ) {
if ( $file ) {
$result->add_message(
false,
sprintf(
/* translators: %s: readme file */
__( 'The %s appears to contain default text.', 'plugin-check' ),
str_replace( $result->plugin()->path( '/' ), '', $file )
),
__( 'The readme appears to contain default text.', 'plugin-check' ),
array(
'code' => 'default_readme_text',
'file' => $file,
'file' => str_replace( $result->plugin()->path(), '', $file ),
)
);
}
Expand All @@ -129,14 +125,10 @@ private function check_license( Check_Result $result, array $files ) {
if ( ! preg_match( '/^([a-z0-9\-\+\.]+)(\sor\s([a-z0-9\-\+\.]+))*$/i', $matches[2] ) ) {
$result->add_message(
false,
sprintf(
/* translators: %s: readme file */
__( 'Your plugin has an invalid license declared. Please update your %s with a valid SPDX license identifier.', 'plugin-check' ),
str_replace( $result->plugin()->path( '/' ), '', $file )
),
__( 'Your plugin has an invalid license declared. Please update your readme with a valid SPDX license identifier.', 'plugin-check' ),
array(
'code' => 'invalid_license',
'file' => $file,
'file' => str_replace( $result->plugin()->path(), '', $file ),
)
);
}
Expand Down Expand Up @@ -166,7 +158,7 @@ private function check_stable_tag( Check_Result $result, array $files ) {
__( "It's recommended not to use 'Stable Tag: trunk'.", 'plugin-check' ),
array(
'code' => 'trunk_stable_tag',
'file' => $file,
'file' => str_replace( $result->plugin()->path(), '', $file ),
)
);
}
Expand All @@ -180,14 +172,10 @@ private function check_stable_tag( Check_Result $result, array $files ) {
) {
$result->add_message(
false,
sprintf(
/* translators: %s: readme file */
__( 'The Stable Tag in your %s file does not match the version in your main plugin file.', 'plugin-check' ),
str_replace( $result->plugin()->path( '/' ), '', $file )
),
__( 'The Stable Tag in your readme file does not match the version in your main plugin file.', 'plugin-check' ),
array(
'code' => 'stable_tag_mismatch',
'file' => $file,
'file' => str_replace( $result->plugin()->path(), '', $file ),
)
);
}
Expand Down

0 comments on commit a21ea17

Please sign in to comment.