jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/375856 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
......................................................................


build: Updating mediawiki/mediawiki-codesniffer to 0.12.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment

Also added "composer fix" command.

Change-Id: I1bd68733db5c1fb2f81f6824ba4561a9f4f621a6
---
M composer.json
M phpcs.xml
M src/N3Quoter.php
M src/NTriplesRdfWriter.php
M src/RdfWriter.php
M src/RdfWriterBase.php
M src/RdfWriterFactory.php
M tests/phpunit/RdfWriterTestBase.php
8 files changed, 25 insertions(+), 18 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index 1243c49..f126fa5 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
                "php": ">=5.5.9"
        },
        "require-dev": {
-               "mediawiki/mediawiki-codesniffer": "0.9.0",
+               "mediawiki/mediawiki-codesniffer": "0.12.0",
                "ockcyp/covers-validator": "~0.4.0",
                "phpunit/phpunit": "4.8.24",
                "phpmd/phpmd": "~2.3"
@@ -56,6 +56,9 @@
                "ci": [
                        "@cs",
                        "@test"
+               ],
+               "fix": [
+                       "phpcbf"
                ]
        }
 }
diff --git a/phpcs.xml b/phpcs.xml
index aaf4035..31c2591 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,7 +1,11 @@
 <?xml version="1.0"?>
 <ruleset name="Purtle">
     <!-- See 
https://github.com/wikimedia/mediawiki-tools-codesniffer/blob/master/MediaWiki/ruleset.xml
 -->
-    <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+    <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
+               <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
         <exclude name="MediaWiki.Commenting.FunctionComment" />
         <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment" />
     </rule>
diff --git a/src/N3Quoter.php b/src/N3Quoter.php
index 70aae88..f7f1899 100644
--- a/src/N3Quoter.php
+++ b/src/N3Quoter.php
@@ -29,7 +29,7 @@
         * @return string
         */
        public function escapeIRI( $iri ) {
-               //FIXME: apply unicode escaping?!
+               // FIXME: apply unicode escaping?!
                return strtr( $iri, [
                                ' ' => '%20',
                                '"' => '%22',
diff --git a/src/NTriplesRdfWriter.php b/src/NTriplesRdfWriter.php
index fe77337..bd64cc3 100644
--- a/src/NTriplesRdfWriter.php
+++ b/src/NTriplesRdfWriter.php
@@ -20,10 +20,10 @@
        ) {
                parent::__construct( $role, $labeler, $quoter );
 
-               //NOTE: The RDF 1.1 spec of N-Triples allows full UTF-8, so 
escaping would not be required.
-               //      However, as of 2015, many consumers of N-Triples still 
expect non-ASCII characters
-               //      to be escaped.
-               //NOTE: if this is changed, getMimeType must be changed 
accordingly.
+               // NOTE: The RDF 1.1 spec of N-Triples allows full UTF-8, so 
escaping would not be required.
+               // However, as of 2015, many consumers of N-Triples still 
expect non-ASCII characters
+               // to be escaped.
+               // NOTE: if this is changed, getMimeType must be changed 
accordingly.
                $this->quoter->setEscapeUnicode( true );
 
                $this->transitionTable[self::STATE_OBJECT] = [
@@ -106,8 +106,8 @@
         * @return string a MIME type
         */
        public function getMimeType() {
-               //NOTE: Add charset=UTF-8 if and when the constructor 
configures $this->quoter
-               //      to write utf-8.
+               // NOTE: Add charset=UTF-8 if and when the constructor 
configures $this->quoter
+               // to write utf-8.
                return 'application/n-triples';
        }
 
diff --git a/src/RdfWriter.php b/src/RdfWriter.php
index 3fb1680..fa5af25 100644
--- a/src/RdfWriter.php
+++ b/src/RdfWriter.php
@@ -35,7 +35,7 @@
  */
 interface RdfWriter {
 
-       //TODO: split: generic RdfWriter class with shorthands, use 
RdfFormatters for output
+       // TODO: split: generic RdfWriter class with shorthands, use 
RdfFormatters for output
 
        /**
         * Returns the local name of a blank node, for use with the "_" prefix.
diff --git a/src/RdfWriterBase.php b/src/RdfWriterBase.php
index 4a2ed69..af7084d 100644
--- a/src/RdfWriterBase.php
+++ b/src/RdfWriterBase.php
@@ -258,7 +258,7 @@
        protected function expandQName( &$base, &$local ) {
                if ( $local !== null && $base !== '_' ) {
                        if ( isset( $this->prefixes[$base] ) ) {
-                               $base = $this->prefixes[$base] . $local; //XXX: 
can we avoid this concat?
+                               $base = $this->prefixes[$base] . $local; // 
XXX: can we avoid this concat?
                                $local = null;
                        } else {
                                throw new LogicException( 'Unknown prefix: ' . 
$base );
diff --git a/src/RdfWriterFactory.php b/src/RdfWriterFactory.php
index dc02000..153429c 100644
--- a/src/RdfWriterFactory.php
+++ b/src/RdfWriterFactory.php
@@ -32,10 +32,10 @@
         * @return string[]
         */
        public function getMimeTypes( $format ) {
-               //NOTE: Maintaining mime types and file extensions in the 
RdfWriter implementations
-               //      is tempting, but means we have to load all these 
classes to find the right
-               //      one for a requested name. Better avoid that overhead 
when serving lots of
-               //      HTTP requests.
+               // NOTE: Maintaining mime types and file extensions in the 
RdfWriter implementations
+               // is tempting, but means we have to load all these classes to 
find the right
+               // one for a requested name. Better avoid that overhead when 
serving lots of
+               // HTTP requests.
 
                switch ( strtolower( $format ) ) {
                        case 'n3':
diff --git a/tests/phpunit/RdfWriterTestBase.php 
b/tests/phpunit/RdfWriterTestBase.php
index 39aaa61..051179c 100644
--- a/tests/phpunit/RdfWriterTestBase.php
+++ b/tests/phpunit/RdfWriterTestBase.php
@@ -376,7 +376,7 @@
                $this->assertEquals( $missing, $extra, $message );
        }
 
-       //FIXME: test non-ascii literals!
-       //FIXME: test uerl-encoding
-       //FIXME: test IRIs!
+       // FIXME: test non-ascii literals!
+       // FIXME: test uerl-encoding
+       // FIXME: test IRIs!
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/375856
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bd68733db5c1fb2f81f6824ba4561a9f4f621a6
Gerrit-PatchSet: 1
Gerrit-Project: purtle
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader <tools.libraryupgra...@tools.wmflabs.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to