[Rt-commit] rt branch, 4.2/untabify, updated. rt-4.1.6-7-gd7b1dff
Alex Vandiver
alexmv at bestpractical.com
Wed Jan 16 14:47:44 EST 2013
The branch, 4.2/untabify has been updated
via d7b1dffb74da7ba7c2f06c468c9faf35a6a50283 (commit)
via 639e3f37191bf5c5941cb7dabd72604915dc5094 (commit)
via b91fdc84dd6016f2ae00c2f6d6e0b0d8192c8c7d (commit)
via 617f76bfcee9dd5fee932acc5c2351d253ba0f79 (commit)
from 07273951d61a15a049316d1ffbb384e060f87226 (commit)
Summary of changes:
t/99-policy.t | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 617f76bfcee9dd5fee932acc5c2351d253ba0f79
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jan 16 14:30:33 2013 -0500
Fix copyright check to run against content, not $_
diff --git a/t/99-policy.t b/t/99-policy.t
index 5994a6b..878c4d8 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -59,7 +59,7 @@ sub check {
$check{bps_tag} = -1 if $check{bps_tag} == 1
and not $content =~ /Copyright\s+\(c\)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/i
and ($content =~ /\b(copyright|GPL|Public Domain)\b/i
- or /\(c\)\s+\d\d\d\d(?:-\d\d\d\d)?/i);
+ or $content =~ /\(c\)\s+\d\d\d\d(?:-\d\d\d\d)?/i);
if ($check{bps_tag} == 1) {
like( $content, qr/[B]EGIN BPS TAGGED BLOCK {{{/, "$file has BPS license tag");
} elsif ($check{bps_tag} == -1) {
commit b91fdc84dd6016f2ae00c2f6d6e0b0d8192c8c7d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jan 16 14:44:52 2013 -0500
Factor out other copyright check to only apply to css and js files
This removes false-positives, such as on t/99-policy.t itself, which
contains the word "copyright".
diff --git a/t/99-policy.t b/t/99-policy.t
index 878c4d8..d5c0f97 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -53,17 +53,20 @@ sub check {
unlike( $content, qr/^#!/, "$file has no shebang" );
}
- $check{bps_tag} = -1 if $check{bps_tag} == 1
+ my $other_copyright = 0;
+ $other_copyright = 1 if $file =~ /\.(css|js)$/
and not $content =~ /Copyright\s+\(c\)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/i
and $file =~ /(?:FCKEditor|scriptaculous|superfish|tablesorter|farbtastic)/i;
- $check{bps_tag} = -1 if $check{bps_tag} == 1
+ $other_copyright = 1 if $file =~ /\.(css|js)$/
and not $content =~ /Copyright\s+\(c\)\s+\d\d\d\d-\d\d\d\d Best Practical Solutions/i
and ($content =~ /\b(copyright|GPL|Public Domain)\b/i
or $content =~ /\(c\)\s+\d\d\d\d(?:-\d\d\d\d)?/i);
+ $check{bps_tag} = -1 if $check{bps_tag} and $other_copyright;
if ($check{bps_tag} == 1) {
like( $content, qr/[B]EGIN BPS TAGGED BLOCK {{{/, "$file has BPS license tag");
} elsif ($check{bps_tag} == -1) {
- unlike( $content, qr/[B]EGIN BPS TAGGED BLOCK {{{/, "$file has no BPS license tag");
+ unlike( $content, qr/[B]EGIN BPS TAGGED BLOCK {{{/, "$file has no BPS license tag"
+ . ($other_copyright ? " (other copyright)" : ""));
}
if ($check{bps_tag} != -1 and $check{no_tabs}) {
commit 639e3f37191bf5c5941cb7dabd72604915dc5094
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jan 16 14:45:24 2013 -0500
Only skip tab detection if there was a different copyright, regardless of if we require our own
diff --git a/t/99-policy.t b/t/99-policy.t
index d5c0f97..73b3e15 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -69,7 +69,7 @@ sub check {
. ($other_copyright ? " (other copyright)" : ""));
}
- if ($check{bps_tag} != -1 and $check{no_tabs}) {
+ if (not $other_copyright and $check{no_tabs}) {
unlike( $content, qr/\t/, "$file has no hard tabs" );
}
}
commit d7b1dffb74da7ba7c2f06c468c9faf35a6a50283
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jan 16 14:45:37 2013 -0500
Switch to using done_testing
diff --git a/t/99-policy.t b/t/99-policy.t
index 73b3e15..34c1558 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use RT::Test nodb => 1;
+use RT::Test nodb => 1, tests => undef;
use File::Find;
use IPC::Run3;
@@ -121,3 +121,5 @@ check( $_, exec => -1 )
check( $_, warnings => 1, strict => 1, compile => 1, no_tabs => 1 )
for grep {m{^etc/upgrade/.*/content$}} @files;
+
+done_testing;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list