Skip to content

Commit

Permalink
Merge pull request #72 from ajolma/use_strict_warnings
Browse files Browse the repository at this point in the history
Use strict and warnings across all perl files
  • Loading branch information
shawnlaffan authored Jun 11, 2024
2 parents 582d9ac + f463c4c commit 9a4b588
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
32 changes: 22 additions & 10 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use strict;
use warnings;

my $have_alien;
BEGIN {
my $gdal = 'Alien::gdal';
my @argv = ();
Expand Down Expand Up @@ -27,10 +31,12 @@ BEGIN {
my $lib = $a[0];
my $data = "$gdal/share/gdal";
print "I'm creating Geo::GDAL::gdal as a wrapper to $lib, which I believe is GDAL $version.\n";

Check failure on line 33 in Makefile.PL

View workflow job for this annotation

GitHub Actions / perl

Use of uninitialized value $lib in concatenation (.) or string
$fh = new IO::File;
my $fh = IO::File->new;
$fh->open("lib/Geo/GDAL/gdal.pm","w");
print $fh <<EOF;

Check failure on line 36 in Makefile.PL

View workflow job for this annotation

GitHub Actions / perl

Use of uninitialized value $lib in concatenation (.) or string
package Geo::GDAL::gdal;
use strict;
use warnings;
sub new {
return shift;
}
Expand All @@ -48,27 +54,33 @@ EOF
} else {
eval "use Alien::Base::Wrapper qw(Alien::gdal !export)";
$have_alien = 1;
$fh = new IO::File;
my $fh = IO::File->new;
$fh->open("lib/Geo/GDAL/gdal.pm","w");
print $fh <<EOF;
package Geo::GDAL::gdal;
use strict;
use warnings;
1;
EOF
}
}
use ExtUtils::MakeMaker;
use Config;
%args = (
my %args = (
AUTHOR => ['Ari Jolma <ari.jolma at gmail.com>'],
NAME => 'Geo::GDAL::FFI',
ABSTRACT_FROM => "lib/Geo/GDAL/FFI.pm",
VERSION_FROM => "lib/Geo/GDAL/FFI.pm",
LICENSE => "artistic_2",
CONFIGURE_REQUIRES => {
Alien::gdal => 0,
'Alien::gdal' => 0,
},
PREREQ_PM => {
PkgConfig => 0.23026,
FFI::Platypus => 0,
PDL => 0,
Sort::Versions => 0,
Alien::gdal => 0,
'PkgConfig' => 0.23026,
'FFI::Platypus' => 0,
'PDL' => 0,
'Sort::Versions' => 0,
'Alien::gdal' => 0,
},
TEST_REQUIRES => {
'Test::More' => 0,
Expand All @@ -91,7 +103,7 @@ use Config;
},
);
if ($have_alien) {
%agrs = (%args, Alien::Base::Wrapper->mm_args);
%args = (%args, Alien::Base::Wrapper->mm_args);
}

WriteMakefile(%args);
5 changes: 4 additions & 1 deletion t/dataset_rasterize.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use 5.010;
use strict;
use warnings;

use Geo::GDAL::FFI;

Check failure on line 5 in t/dataset_rasterize.t

View workflow job for this annotation

GitHub Actions / perl

Compilation failed in require

use Test::More;
Expand Down Expand Up @@ -162,7 +165,7 @@ sub test_Rasterize {


sub get_test_raster {
my $name = 'test_ras' . time() + rand() . '.tiff';
my $name = 'test_ras' . (time() + rand()) . '.tiff';
my $tiff = Geo::GDAL::FFI::GetDriver('GTiff')->Create('test.tiff', 3, 2);
my $ogc_wkt =
'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS84",6378137,298.257223563,'.
Expand Down

0 comments on commit 9a4b588

Please sign in to comment.