r47281 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47280‎ | r47281 | r47282 >
Date:00:30, 15 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
tweaks isRelevant() to use work counts
Modified paths:
  • /trunk/extensions/CodeReview/CodeReleaseNotes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReleaseNotes.php
@@ -100,6 +100,7 @@
101101 $wgOut->addHTML( '</ul>' );
102102 }
103103
 104+ // Quick relevance tests (these *should* be over-inclusive a little if anything)
104105 private function isRelevant( $summary ) {
105106 # Fixed a bug?
106107 if( preg_match( '/\bbug #?(\d+)\b/i', $summary, $m ) )
@@ -108,13 +109,13 @@
109110 if( preg_match( '/\b\$wg[a-bA-Z]{3,100}\b/', $summary, $m ) )
110111 return true;
111112 # Sanity check: summary cannot be *too* short to be useful
112 - if( mb_strlen($summary) < 40 )
 113+ if( mb_strlen($summary) < 40 || str_word_count($summary) <= 5 )
113114 return false;
114115 # All caps words? like "BREAKING CHANGE"
115116 if( preg_match( '/\b[A-Z]{8,20}\b/', $summary, $m ) )
116117 return true;
117118 # Longish summary :)
118 - if( mb_strlen($summary) > 250 )
 119+ if( str_word_count($summary) > 35 )
119120 return true;
120121 # Otherwise false
121122 return false;

Status & tagging log