Add support for Python

This commit is contained in:
Pierre Pronchery 2020-11-04 18:32:12 +01:00
parent 907643b4a0
commit ddece6dc22

View File

@ -100,6 +100,10 @@ _fixme_callback()
echo "_fixme_callback_sh"
return 0
;;
py)
echo "_fixme_callback_python"
return 0
;;
htm|html|xml|xsl)
echo "_fixme_callback_xml"
return 0
@ -111,6 +115,10 @@ _fixme_callback()
echo "_fixme_callback_sh"
return 0
;;
"#!/usr/bin/env python"*|"#! /usr/bin/env python"*)
echo "_fixme_callback_python"
return 0
;;
"<html"*|"<?xml"*)
echo "_fixme_callback_xml"
return 0
@ -143,6 +151,19 @@ _fixme_callback_c()
return $res
}
_fixme_callback_python()
{
res=0
filename="$1"
comment="#"
#warnings
$GREP -nH "$comment.*$REGEXP_WARNING" "$filename"
#failures
$GREP -nH "$comment.*$REGEXP_ERROR" "$filename" && res=2
return $res
}
_fixme_callback_sh()
{
res=0