Thiemo Mättig (WMDE) has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/351869 )
Change subject: Decrease limeLimit PHPCS sniff to 219
......................................................................
Decrease limeLimit PHPCS sniff to 219
Change-Id: I2522fcc70316c260ecb0168536b99961445d4f6c
---
M phpcs.xml
M tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
2 files changed, 19 insertions(+), 4 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
refs/changes/69/351869/1
diff --git a/phpcs.xml b/phpcs.xml
index c0aa75c..2d9c4ab 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -13,8 +13,8 @@
<rule ref="Generic.Files.LineLength">
<properties>
<!-- FIXME: Should be lowered to at least 140. -->
- <property name="lineLimit" value="391" />
- <property name="absoluteLineLimit" value="391" />
+ <property name="lineLimit" value="219" />
+ <property name="absoluteLineLimit" value="219" />
</properties>
</rule>
diff --git a/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
b/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
index 2a630b1..a63fef8 100644
--- a/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
+++ b/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
@@ -88,7 +88,14 @@
}
public function testFormatConstraintTaxonName() {
- $pattern =
"(|somevalue|novalue|.*virus.*|.*viroid.*|.*phage.*|((×)?[A-Z]([a-z]+-)?[a-z]+((
[A-Z]?[a-z]+)|( ([a-z]+-)?([a-z]+-)?[a-z]+)|(
×([a-z]+-)?([a-z]+-)?([a-z]+-)?([a-z]+-)?[a-z]+)|( \([A-Z][a-z]+\) [a-z]+)|(
(‘|')[A-Z][a-z]+(('|’)s)?( de)?( [A-Z][a-z]+(-([A-Z])?[a-z]+)*)*('|’)*)|( ×|
Group| (sub)?sp\.| (con)?(sub)?(notho)?var\.| (sub)?ser\.| (sub)?sect\.|
subg\.| (sub)?f\.))*))";
+ $pattern =
'(|somevalue|novalue|.*virus.*|.*viroid.*|.*phage.*|((×)?[A-Z]([a-z]+-)?[a-z]+('
+ . '( [A-Z]?[a-z]+)|'
+ . '( ([a-z]+-)?([a-z]+-)?[a-z]+)|'
+ . '( ×([a-z]+-)?([a-z]+-)?([a-z]+-)?([a-z]+-)?[a-z]+)|'
+ . '( \([A-Z][a-z]+\) [a-z]+)|'
+ . "( (‘|')[A-Z][a-z]+(('|’)s)?( de)?(
[A-Z][a-z]+(-([A-Z])?[a-z]+)*)*('|’)*)|"
+ . '( ×| Group| (sub)?sp\.| (con)?(sub)?(notho)?var\.|
(sub)?ser\.| (sub)?sect\.|'
+ . ' subg\.| (sub)?f\.))*))';
$value1 = new StringValue( 'Populus × canescens' );
$value2 = new StringValue( 'Encephalartos friderici-guilielmi'
);
@@ -132,7 +139,15 @@
}
public function testFormatConstraintNoStringValue() {
- $pattern =
"(|somevalue|novalue|.*virus.*|.*viroid.*|.*phage.*|((×)?[A-Z]([a-z]+-)?[a-z]+((
[A-Z]?[a-z]+)|( ([a-z]+-)?([a-z]+-)?[a-z]+)|(
×([a-z]+-)?([a-z]+-)?([a-z]+-)?([a-z]+-)?[a-z]+)|( \([A-Z][a-z]+\) [a-z]+)|(
(‘|')[A-Z][a-z]+(('|’)s)?( de)?( [A-Z][a-z]+(-([A-Z])?[a-z]+)*)*('|’)*)|( ×|
Group| (sub)?sp\.| (con)?(sub)?(notho)?var\.| (sub)?ser\.| (sub)?sect\.|
subg\.| (sub)?f\.))*))";
+ $pattern =
'(|somevalue|novalue|.*virus.*|.*viroid.*|.*phage.*|((×)?[A-Z]([a-z]+-)?[a-z]+('
+ . '( [A-Z]?[a-z]+)|'
+ . '( ([a-z]+-)?([a-z]+-)?[a-z]+)|'
+ . '( ×([a-z]+-)?([a-z]+-)?([a-z]+-)?([a-z]+-)?[a-z]+)|'
+ . '( \([A-Z][a-z]+\) [a-z]+)|'
+ . "( (‘|')[A-Z][a-z]+(('|’)s)?( de)?(
[A-Z][a-z]+(-([A-Z])?[a-z]+)*)*('|’)*)|"
+ . '( ×| Group| (sub)?sp\.| (con)?(sub)?(notho)?var\.|
(sub)?ser\.| (sub)?sect\.|'
+ . ' subg\.| (sub)?f\.))*))';
+
$value = new EntityIdValue( new ItemId( 'Q1' ) );
$statement = new Statement( new PropertyValueSnak( new
PropertyId( 'P345' ), $value ) );
$this->assertEquals( 'violation',
$this->formatChecker->checkConstraint( $statement, $this->getConstraintMock(
array( 'pattern' => $pattern ) ), $this->getEntity() )->getStatus(), 'check
should not comply' );
--
To view, visit https://gerrit.wikimedia.org/r/351869
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2522fcc70316c260ecb0168536b99961445d4f6c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits