[Rt-commit] rt branch, 4.2/perlcritic, repushed
Alex Vandiver
alexmv at bestpractical.com
Sat Apr 11 19:14:04 EDT 2015
The branch 4.2/perlcritic was deleted and repushed:
was 9ec82f77e1e737a6a9606892f249af8191b2cc89
now 6a864416c6d3d766585e8b91bd5dadb7e744a3d8
1: a37dae6 ! 1: ea77270 Replace the deprecated UNIVERSAL::can with $obj->can in various forms
@@ -147,7 +147,7 @@
}
return $args{'String'} if $args{'String'};
- return $args{'Object'}->UID if UNIVERSAL::can($args{'Object'}, 'UID' );
-+ return $args{'Object'}->UID if Scalar::Util::blessed($args{'Object'}) and $args{'Object'}->can('_AsString');
++ return $args{'Object'}->UID if Scalar::Util::blessed($args{'Object'}) and $args{'Object'}->can('UID');
return '';
}
2: 5ac0853 = 2: 9df264f Replace the UNIVERSAL::isa calls which degenerate to ref() with just that
3: cb8204d = 3: 512d1c1 Replace UNIVERSAL::isa checks in tests with the more correct isa_ok
4: 980a78b = 4: 9b2a834 Replace UNIVERSAL::isa(errno,$id) with the certainly-intended reverse
5: e39cdf3 = 5: 1320d5f Store $@ as soon as possible in error handler
6: ed02d87 = 6: 96b7a64 Replace UNIVERSAL::isa(...)'s usage to mean "instanceof" with blessed && ->isa()
7: 3f4b291 = 7: 71c909d Replace UNIVERSAL::isa(...)'s usage to mean "class is a subclass of" with just ->isa()
8: 5a36f12 = 8: c8e1d5c Use ->can() to dispatch, rather than a string eval
9: e3e1af1 = 9: 0d36584 Don't use bareword filehandles
10: 2db5e30 = 10: 4f81ef6 Use explicit glob() function, instead of <*>
11: 1686c5f ! 11: 704acd0 Don't modify $_ in map and grep
@@ -192,9 +192,9 @@
- } @values;
+ my @values;
+ for my $v (@_) {
-+ if (ref eq 'ARRAY') {
-+ push @values, join "", $self->_ProcessReturnValues(@$v);
-+ } elsif (ref eq 'SCALAR') {
++ if (ref($v) eq 'ARRAY') {
++ push @values, join("", $self->_ProcessReturnValues(@$v));
++ } elsif (ref($v) eq 'SCALAR') {
+ push @values, $$v;
+ } else {
+ RT::Interface::Web::EscapeHTML(\$v);
12: 09ec406 = 12: 0f6c52a Switch from a string eval to using UNIVERSAL::require
13: 6574c27 = 13: 5d632a8 Remove an unnecessary use of string eval
14: dd1c9c2 = 14: b5c263e Mark all of the explicitly-allowed string evals
15: 3a8f893 = 15: 3184ae8 Ensure that all loop variables are properly localized
16: 93004f8 = 16: f823433 Remove some unnecessary subroutine prototypes
17: a4e3d24 = 17: c38b5b3 Subroutine prototypes that start with & are of use; allow them
18: 02cca5f = 18: 84247aa cmp_version is ($$) so it can be used directly by sort()
19: e21cdd0 = 19: 0c54b97 Replace several uses of stash plundering with $package->can($method)
20: 04dc47f = 20: 4e1225e We are unable to add "use strict" because of the package vars, but we can at least enable warnings
21: f80b89b = 21: 7c0dd20 Remove unreachable code after unconditional return statements
22: ffcebd5 = 22: 004cc7a Fix "my $x = ... if ..." traps
23: c3fdb9f ! 23: 0cbec4a Remove a bit more indirect object notation
@@ -43,6 +43,11 @@
use constant VALUES_CLASS => 'RT::CustomFieldValues::Groups';
RT->Config->Set(CustomFieldValuesSources => VALUES_CLASS);
+-my $q = new( RT::Queue );
++my $q = RT::Queue->new( RT->SystemUser );
+ isa_ok( $q, 'RT::Queue' );
+ my ($qid) = $q->Create( Name => "CF-External-". $$ );
+ ok( $qid, "created queue" );
@@
MaxValues => 1,
ValuesClass => VALUES_CLASS );
24: de407fd = 24: 4c3cf60 Rename functions so they don't conflict with built-ins
25: 6fd01ba = 25: ee15f08 Make all "no strict" usages be scoped to a single line
26: f656f22 = 26: e11958c Remove "no warnings" lines where possible
27: 996572c = 27: b971d4d Remove instances of comma-as-statement-separator
28: 2eede7e = 28: 1e9dfa7 Rejigger some commas which perlcritic mistook for statement separators
29: 999e765 = 29: e5b9253 Resolve mixed high and low precedence boolean operators, in favor of low-precedence
30: 6c0c908 = 30: cdf66b8 $, hasn't been a problem since Log::Dispatch 1.79; we require 2.0 in rt-test-dependencies
31: 8c9aad6 = 31: 1373a68 Move the already-compile-time use line to the top; the version requirement is also superfluous
32: 24bb7d4 = 32: 10d1d1b Remove uses of lexical $a variable
33: 892bb4e = 33: 34f41e8 Remove a case of map in void context
34: 6c6bf5a = 34: 272f684 Fix cases of using $1 without checking the regex -- or perlcritic thinks we do
35: a89d0a8 = 35: b178945 Remove variables declared but not used
36: 426bde5 = 36: 173b812 Access config variables through RT->Config->Get rather than reaching into RT::
37: 8437b6c = 37: 5d81431 _WhoHaveRoleRightSplitted should have been removed from Users in 932a5a2
38: 47dc2bd = 38: 72c6990 Explicitly initialize local'd variables to undef or another appropriate value
39: cf65bd1 = 39: e722e4b Change occurrences of split( 'string', ... ) into split( /regex/, ... )
40: 855c610 = 40: 7053569 Check the return value of close()
41: 099f04f = 41: d4854e7 Proper localization of $_ reveals wrong variable in use
42: 1a9fca6 = 42: 78d0400 Remove a useless use of require "path/to/file.pm"
43: 6a3bc26 = 43: 4c97eb8 Move "use strict; use warnings;" to top
44: d943f39 = 44: 832d3df Switch from lax (":utf8") to strict (":encoding(UTF-8)") layers
45: 4d6038a = 45: d879d0a Make the octal-ness of this constant explicit
46: be96495 = 46: c1bc438 Add "use strict" to test plugins as well
47: 9ec82f7 = 47: 6a86441 Move standalone t/lifecycles/utils.pl to being an RT::Test
More information about the rt-commit
mailing list