Unverified Commit 5ccddbeb authored by Magali Ruffier's avatar Magali Ruffier Committed by GitHub
Browse files

Merge pull request #24 from Ensembl/feature/new_licence_format

allow new licence format without copyright year
parents bb40a112 de5cf49a
...@@ -460,7 +460,7 @@ sub all_has_apache2_licence { ...@@ -460,7 +460,7 @@ sub all_has_apache2_licence {
=cut =cut
sub has_apache2_licence { sub has_apache2_licence {
my ($file) = @_; my ($file, $no_affiliation) = @_;
my $count = 0; my $count = 0;
my $max_lines = 30; my $max_lines = 30;
my ($found_copyright, $found_url, $found_warranties, $skip_test, $found_sanger_embl_ebi_year, $found_embl_ebi_year) = (0,0,0,0,0,0); my ($found_copyright, $found_url, $found_warranties, $skip_test, $found_sanger_embl_ebi_year, $found_embl_ebi_year) = (0,0,0,0,0,0);
...@@ -484,8 +484,12 @@ sub has_apache2_licence { ...@@ -484,8 +484,12 @@ sub has_apache2_licence {
if($skip_test) { if($skip_test) {
return __PACKAGE__->builder->ok(1, "$file has a no critic (RequireApache2Licence) directive"); return __PACKAGE__->builder->ok(1, "$file has a no critic (RequireApache2Licence) directive");
} }
if($found_copyright && $found_url && $found_warranties && $found_sanger_embl_ebi_year && $found_embl_ebi_year) { if($found_copyright && $found_url && $found_warranties) {
return __PACKAGE__->builder->ok(1, "$file has a Apache v2.0 licence declaration and correct Copyright year [2016-$current_year]"); if ($found_sanger_embl_ebi_year && $found_embl_ebi_year) {
return __PACKAGE__->builder->ok(1, "$file has an Apache v2.0 licence declaration and correct Copyright year [2016-$current_year]");
} elsif ($no_affiliation) {
return __PACKAGE__->builder->ok(1, "$file has an Apache v2.0 licence declaration with no Copyright year");
}
} }
__PACKAGE__->builder->diag("$file is missing Apache v2.0 declaration") unless $found_copyright; __PACKAGE__->builder->diag("$file is missing Apache v2.0 declaration") unless $found_copyright;
__PACKAGE__->builder->diag("$file is missing Apache URL") unless $found_url; __PACKAGE__->builder->diag("$file is missing Apache URL") unless $found_url;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment