[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#795614: [PATCH] fix false-positive spelling-error-in-binary affecting many Go binaries



On 2015-08-15 21:59, Michael Stapelberg wrote:
> Package: lintian
> Version: 2.5.33
> Severity: normal
> Tags: patch
> 
>>From the patch description:
>  [PATCH] spelling-error-in-binary: ignore ang/and
>  
>  The Go stdlib html/ package contains the string "ang;" (for the ∠
>  entity). Every program which directly or indirectly imports the html/
>  package will hence end up with an unuseful spelling-error-in-binary
>  lintian warning.
> 
> [...]

Hi Michael,

Thanks for the patch.

I was wondering, have you tried something like?

"""
$ git diff
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 4b08fae..0b11477 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -301,6 +301,7 @@ sub check_spelling {
     $text =~ s/(\w-)\s*\n\s*/$1/;
     $text =~ tr/\r\n \t/ /s;
     $text =~ s/\s++/ /g;
+    $text =~ s/\&[a-zA-Z0-9_-]+\;//g; # Ignore XML entities
     strip($text);

     for my $word (split(' ', $text)) {
"""

AFAICT, it should strip out all XML entities (untested though), which
should be a more generic solution.  Does this work for you?

Thanks,
~Niels


Reply to: