Skip to content

Commit

Permalink
Merge pull request #668 from WordPress/667-redundant-test-for-stable-tag
Browse files Browse the repository at this point in the history
Do not go for next check if Stable Tag value is trunk
  • Loading branch information
ernilambar authored Sep 26, 2024
2 parents 64cf979 + 0dd3050 commit b79f658
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions includes/Checker/Checks/Plugin_Repo/Plugin_Readme_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ private function check_stable_tag( Check_Result $result, string $readme_file, Pa
'https://developer.wordpress.org/plugins/wordpress-org/common-issues/#incorrect-stable-tag',
9
);

return;
}

// Check the readme file Stable tag against the plugin's main file version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public function test_run_with_errors_stable_tag() {
$this->assertArrayHasKey( 0, $errors['readme.txt'][0] );
$this->assertCount( 1, wp_list_filter( $errors['readme.txt'][0][0], array( 'code' => 'trunk_stable_tag' ) ) );

// Check for stable tag mismatch file error.
$this->assertCount( 1, wp_list_filter( $errors['readme.txt'][0][0], array( 'code' => 'stable_tag_mismatch' ) ) );
// Check for stable tag mismatch file error. This should NOT be triggered as there is already 'trunk_stable_tag' error.
$this->assertCount( 0, wp_list_filter( $errors['readme.txt'][0][0], array( 'code' => 'stable_tag_mismatch' ) ) );
}

public function test_run_with_errors_no_stable_tag() {
Expand Down Expand Up @@ -212,7 +212,6 @@ public function test_run_md_with_errors() {
$this->assertArrayHasKey( 'readme.md', $errors );

$this->assertCount( 1, wp_list_filter( $errors['readme.md'][0][0], array( 'code' => 'trunk_stable_tag' ) ) );
$this->assertCount( 1, wp_list_filter( $errors['readme.md'][0][0], array( 'code' => 'stable_tag_mismatch' ) ) );
$this->assertCount( 1, wp_list_filter( $errors['readme.md'][0][0], array( 'code' => 'outdated_tested_upto_header' ) ) );

$this->assertNotEmpty( $warnings );
Expand Down

0 comments on commit b79f658

Please sign in to comment.