[darcs-users] [patch446] resolve issue1988: enable warn-unused-do-bind

Gabriel Kerneis bugs at darcs.net
Fri Nov 5 09:48:51 UTC 2010


Gabriel Kerneis <kerneis at pps.jussieu.fr> added the comment:

Hi,

I enabled warnings in darcs.cabal, ran "cabal build 2>cabal.log", edited
the resulting file to keep only warnings related to issue1988 and then
ran the following script:
----------------------------------------------------------------------
#!/bin/sh
awk 'BEGIN { RS = "" ; FS = "\n" }
  {s=$1;
   i=2;
   while(match($i,"Suppress")==0) { s=(s $i); i++}
   gsub(/ +/," ",s);
   print s}' < cabal.log | sort -ur |\
awk 'BEGIN { FS = ":" }
   {
	   cur = $1 $2 $3
	   if(prev != cur) {
		   printf(":execute \"edit %s\"\n",$1)
		   printf(":execute \"normal %sG0%sli_ <- \\<Esc>\"\n",$2,$3)
		   printf(":execute \"normal O-- Warning: %s\\<Esc>\"\n",$5)
		   printf(":execute \"write %s\"\n",$1)
	   } else
	   { printf("\" skipping %s:%s:%s\n", $1,$2,$3) }
	   prev = cur
   }' > convert.vim
----------------------------------------------------------------------
It produces a vim script file, which I ran in the root of the darcs
repository, with ":source convert.vim".

The resulting patch is useful because it helps spotting warnings
introduced by future patches to darcs: even if it takes times to check
that the 163 silenced warnings of this patch are effectively harmless, we
can at least avoid adding new such warnings.

Best,
			Gabriel

1 patch for repository http://darcs.net:

Fri Nov  5 10:29:33 CET 2010  Gabriel Kerneis <kerneis at pps.jussieu.fr>
  * resolve issue1988: enable warn-unused-do-bind
  
  This patch enables warn-unused-do-bind and silences the 163 warnings of
  that kind spread accross darcs code.
  
  Please note that that this patch has been automatically generated by a
  shell script.  It does not change or break anything, but might silence
  warnings which are actual bugs.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch446>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolve-issue1988_-enable-warn_unused_do_bind.dpatch
Type: text/x-darcs-patch
Size: 119589 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101105/7de485f7/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20101105/7de485f7/attachment-0001.obj>


More information about the darcs-users mailing list