Check Makefile.am's. Add a few more checks.
authorDavid Schleef <ds@schleef.org>
Sat, 9 Aug 2003 23:41:59 +0000 (23:41 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 9 Aug 2003 23:41:59 +0000 (23:41 +0000)
Original commit message from CVS:
Check Makefile.am's.  Add a few more checks.

tests/old/testsuite/gst-lint
testsuite/gst-lint

index e0c9d9c..fa80640 100755 (executable)
@@ -33,6 +33,10 @@ sub check_indentation();
 sub check_gst_props_set();
 sub check_deprecated();
 sub check_config_h();
+sub check_varargs_functions();
+sub check_debugging();
+
+sub m_check_plugindir();
 
 open FIND, "find . -name \"*.[ch]\" -print|";
 
@@ -40,6 +44,7 @@ foreach $filename (<FIND>) {
        chomp $filename;
        open FILE, "$filename";
        @lines = <FILE>;
+       close FILE;
 
        print "I: $filename\n";
 
@@ -56,6 +61,21 @@ foreach $filename (<FIND>) {
        check_gst_props_set();
        check_deprecated();
        check_config_h();
+       check_varargs_functions();
+       check_debugging();
+}
+
+open FIND, "find . -name \"Makefile.am\" -print|";
+
+foreach $filename (<FIND>) {
+       chomp $filename;
+       open FILE, "$filename";
+       @lines = <FILE>;
+       close FILE;
+
+       print "I: $filename\n";
+
+       m_check_plugindir();
 }
 
 #
@@ -269,4 +289,42 @@ sub check_config_h()
        }
 
 }
+  
+#
+# Check for functions that take varargs to make sure they are
+# named correctly
+#
+sub check_varargs_functions()
+{
+       if($filename =~ /\.h$/){
+               if (grep { /varargs/; } @lines) {
+                       print "I: has varargs\n";
+               }
+       }
+}
+
+#
+# Debugging checks
+#
+sub check_debugging()
+{
+       if (grep { /\Wg_print\W/; } @lines) {
+               print "W: friendly libraries don't use g_print\n";
+       }
+
+       if (grep { /GST_DEBUG.*\\n"/; } @lines) {
+               print "W: possible newline in GST_DEBUG()\n";
+       }
+
+}
+
+#
+# check for plugindir=
+#
+sub m_check_plugindir()
+{
+       if (grep { /plugindir\s*=/; } @lines) {
+               print "E: plugindir= is no longer necessary\n"
+       }
+}
 
index e0c9d9c..fa80640 100755 (executable)
@@ -33,6 +33,10 @@ sub check_indentation();
 sub check_gst_props_set();
 sub check_deprecated();
 sub check_config_h();
+sub check_varargs_functions();
+sub check_debugging();
+
+sub m_check_plugindir();
 
 open FIND, "find . -name \"*.[ch]\" -print|";
 
@@ -40,6 +44,7 @@ foreach $filename (<FIND>) {
        chomp $filename;
        open FILE, "$filename";
        @lines = <FILE>;
+       close FILE;
 
        print "I: $filename\n";
 
@@ -56,6 +61,21 @@ foreach $filename (<FIND>) {
        check_gst_props_set();
        check_deprecated();
        check_config_h();
+       check_varargs_functions();
+       check_debugging();
+}
+
+open FIND, "find . -name \"Makefile.am\" -print|";
+
+foreach $filename (<FIND>) {
+       chomp $filename;
+       open FILE, "$filename";
+       @lines = <FILE>;
+       close FILE;
+
+       print "I: $filename\n";
+
+       m_check_plugindir();
 }
 
 #
@@ -269,4 +289,42 @@ sub check_config_h()
        }
 
 }
+  
+#
+# Check for functions that take varargs to make sure they are
+# named correctly
+#
+sub check_varargs_functions()
+{
+       if($filename =~ /\.h$/){
+               if (grep { /varargs/; } @lines) {
+                       print "I: has varargs\n";
+               }
+       }
+}
+
+#
+# Debugging checks
+#
+sub check_debugging()
+{
+       if (grep { /\Wg_print\W/; } @lines) {
+               print "W: friendly libraries don't use g_print\n";
+       }
+
+       if (grep { /GST_DEBUG.*\\n"/; } @lines) {
+               print "W: possible newline in GST_DEBUG()\n";
+       }
+
+}
+
+#
+# check for plugindir=
+#
+sub m_check_plugindir()
+{
+       if (grep { /plugindir\s*=/; } @lines) {
+               print "E: plugindir= is no longer necessary\n"
+       }
+}