summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-10-17 18:02:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-10-17 18:02:47 +0000
commitb0b541d280ec32199af631eb97d71599643f285a (patch)
tree4271712b62ea3de8745ded7bc8af012b03cb76ff
parente93410db0c1326ac5895ba2105904698c7ee163e (diff)
downloadperl-MDK-Common-b0b541d280ec32199af631eb97d71599643f285a.tar
perl-MDK-Common-b0b541d280ec32199af631eb97d71599643f285a.tar.gz
perl-MDK-Common-b0b541d280ec32199af631eb97d71599643f285a.tar.bz2
perl-MDK-Common-b0b541d280ec32199af631eb97d71599643f285a.tar.xz
perl-MDK-Common-b0b541d280ec32199af631eb97d71599643f285a.zip
add a check for function call PKG::f instead of PKG::f()
-rw-r--r--perl-MDK-Common.spec5
-rwxr-xr-xperl_checker8
2 files changed, 12 insertions, 1 deletions
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index bfc1c40..2f781f8 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -2,7 +2,7 @@
# do not change the version here, change in MDK/Common.pm.pl
%define version THEVERSION
-%define release 16mdk
+%define release 17mdk
Summary: Various simple functions
Name: perl-MDK-Common
@@ -50,6 +50,9 @@ rm -rf $RPM_BUILD_ROOT
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Thu Oct 17 2002 Pixel <pixel@mandrakesoft.com> 1.0.3-17mdk
+- add a check for function call PKG::f instead of PKG::f()
+
* Fri Sep 6 2002 Pixel <pixel@mandrakesoft.com> 1.0.3-16mdk
- MDK::Common::System::update_gnomekderc: fix adding lines to the last section when it doesn't end with a cr
diff --git a/perl_checker b/perl_checker
index 9d2788e..c40c505 100755
--- a/perl_checker
+++ b/perl_checker
@@ -205,7 +205,15 @@ sub syntax_warnings {
}
sub syntax_warnings_after_removing_strings_and_regexps {
+ local $_ = $_;
+ s/\bqw\([^)]*\)/'foo'/g;
+ if (my ($before, $f, $pkg, $after) = /(.*[^a-zA-Z0-9_:@*%&\$])((\w+::)+\w+)\s*([^a-zA-Z0-9_(: {].*)/) {
+ if ($before !~ /(sub|use|package|require|new|->)\s*$/ && $after !~ /^->/) {
+ $pkg =~ s/::$//;
+ warn_(qq($f must be written $f() otherwise it will not work if "use $pkg" is replaced by "require $pkg"), info());
+ }
+ }
if (/\}->([{\[])/) {
warn_(qq("}->$2" is better written "}$2"), info());