Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 648e932

Browse files
committed
PERL-667 Add and pass minimal Perl::Critic release tests
1 parent 56a972c commit 648e932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+192
-7
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
{{ $NEXT }}
44

5+
[~ Internal changes ~]
6+
7+
- PERL-667 Add and pass Perl::Critic tests before release
8+
59
v1.5.0 2016-09-19 15:26:09-07:00 America/Los_Angeles (TRIAL RELEASE)
610

711
[*** Deprecations ***]

dist.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ max_target_perl = 5.008001
6363
;also_private = qr/^[A-Z_]+$/
6464

6565
; check Perl::Critic
66-
;[Test::Perl::Critic]
66+
[Test::Perl::Critic]
6767

6868
;[Test::LocalBrew]
6969
;brews = perl-5.10.1

lib/MongoDB/BSON.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BSON;
1820

1921

lib/MongoDB/BSON/Binary.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BSON::Binary;
1820
# ABSTRACT: MongoDB binary type
1921

lib/MongoDB/BSON/Regexp.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use strict;
2+
use warnings;
13
package MongoDB::BSON::Regexp;
24
# ABSTRACT: Regular expression type
35

lib/MongoDB/BSON/_EncodedDoc.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BSON::_EncodedDoc;
1820

1921
# Wrapper for pre-encoded BSON documents, with optional metadata

lib/MongoDB/BulkWrite.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BulkWrite;
1820

1921
# ABSTRACT: MongoDB bulk write interface

lib/MongoDB/BulkWriteResult.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BulkWriteResult;
1820

1921
# ABSTRACT: MongoDB bulk write result document

lib/MongoDB/BulkWriteView.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::BulkWriteView;
1820

1921
# ABSTRACT: Bulk write operations against a query document

lib/MongoDB/Code.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Code;
1820

1921

lib/MongoDB/Collection.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Collection;
1820

1921

lib/MongoDB/CommandResult.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::CommandResult;
1820

1921
# ABSTRACT: MongoDB generic command result document

lib/MongoDB/Cursor.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Cursor;
1820

1921

lib/MongoDB/DBRef.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::DBRef;
1820

1921
# ABSTRACT: A MongoDB database reference

lib/MongoDB/Database.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Database;
1820

1921

lib/MongoDB/DeleteResult.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::DeleteResult;
1820

1921
# ABSTRACT: MongoDB deletion result object

lib/MongoDB/GridFS.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
use strict;
17+
use warnings;
1618
package MongoDB::GridFS;
1719

1820
# ABSTRACT: A file storage abstraction (DEPRECATED)
@@ -245,7 +247,7 @@ sub find_one {
245247
$criteria ||= {};
246248

247249
my $file = $self->files->find_one($criteria, $fields);
248-
return undef unless $file;
250+
return undef unless $file; ## no critic
249251
return MongoDB::GridFS::File->new({_grid => $self,info => $file});
250252
}
251253

lib/MongoDB/GridFS/File.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::GridFS::File;
1820

1921

lib/MongoDB/GridFSBucket.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
use strict;
17+
use warnings;
1618
package MongoDB::GridFSBucket;
1719

1820
# ABSTRACT: A file storage abstraction

lib/MongoDB/GridFSBucket/DownloadStream.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
use strict;
17+
use warnings;
1618
package MongoDB::GridFSBucket::DownloadStream;
1719

1820
# ABSTRACT: File handle abstraction for downloading

lib/MongoDB/GridFSBucket/UploadStream.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
use strict;
17+
use warnings;
1618
package MongoDB::GridFSBucket::UploadStream;
1719

1820
# ABSTRACT: File handle abstraction for uploading

lib/MongoDB/IndexView.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::IndexView;
1820

1921
# ABSTRACT: Index management for a collection

lib/MongoDB/InsertManyResult.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::InsertManyResult;
1820

1921
# ABSTRACT: MongoDB single insert result object

lib/MongoDB/InsertOneResult.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::InsertOneResult;
1820

1921
# ABSTRACT: MongoDB single insert result object

lib/MongoDB/MongoClient.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::MongoClient;
1820

1921
# ABSTRACT: A connection to a MongoDB server or multi-server deployment

lib/MongoDB/OID.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::OID;
1820

1921
# ABSTRACT: A Mongo Object ID

lib/MongoDB/Op/_Aggregate.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Aggregate;
1820

1921
# Encapsulate aggregate operation; return MongoDB::QueryResult

lib/MongoDB/Op/_BatchInsert.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_BatchInsert;
1820

1921
# Encapsulate a multi-document insert operation; returns a

lib/MongoDB/Op/_BulkWrite.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_BulkWrite;
1820

1921
# Encapsulate a multi-document multi-operation write; returns a
@@ -380,7 +382,7 @@ sub _execute_legacy_batch {
380382
return $_->result;
381383
}
382384
die $_ unless $w_0 && /exceeds maximum size/;
383-
return undef;
385+
return undef; ## no critic: this makes op_result undef
384386
};
385387

386388
my $gle_result =

lib/MongoDB/Op/_Command.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Command;
1820

1921
# Encapsulate running a command and returning a MongoDB::CommandResult

lib/MongoDB/Op/_Count.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Count;
1820

1921
# Encapsulate code path for count commands

lib/MongoDB/Op/_CreateIndexes.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_CreateIndexes;
1820

1921
# Encapsulate index creation operations; returns a MongoDB::CommandResult

lib/MongoDB/Op/_Delete.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Delete;
1820

1921
# Encapsulate a delete operation; returns a MongoDB::DeleteResult

lib/MongoDB/Op/_Distinct.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Distinct;
1820

1921
# Encapsulate distinct operation; return MongoDB::QueryResult

lib/MongoDB/Op/_DropCollection.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_DropCollection;
1820

1921
# Implements a collection drop; returns a MongoDB::CommandResult

lib/MongoDB/Op/_DropDatabase.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_DropDatabase;
1820

1921
# Implements a database drop; returns a MongoDB::CommandResult

lib/MongoDB/Op/_DropIndexes.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_DropIndexes;
1820

1921
# Implements index drops; returns a MongoDB::CommandResult

lib/MongoDB/Op/_Explain.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_Explain;
1820

1921
# Encapsulate code path for explain commands/queries

lib/MongoDB/Op/_FSyncUnlock.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_FSyncUnlock;
1820

1921
# Encapsulate collection list operations; returns arrayref of collection

lib/MongoDB/Op/_FindAndDelete.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_FindAndDelete;
1820

1921
# Encapsulate find_and_delete operation; atomically delete and return doc

lib/MongoDB/Op/_FindAndUpdate.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_FindAndUpdate;
1820

1921
# Encapsulate find_and_update operation; atomically update and return doc

lib/MongoDB/Op/_GetMore.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17+
use strict;
18+
use warnings;
1719
package MongoDB::Op::_GetMore;
1820

1921
# Encapsulate a cursor fetch operation; returns raw results object

0 commit comments

Comments
 (0)