darcs

Patch 446 resolve issue1988: enable warn-unused-do-bind

Title resolve issue1988: enable warn-unused-do-bind
Superseder Nosy List kerneis
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-11-04.14:20:01 by kerneis, last changed 2011-05-10.22:36:33 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
explain-do_notation-comments-in-readme.dpatch kerneis, 2010-11-05.10:22:44 text/x-darcs-patch
resolve-issue1988_-enable-warn_unused_do_bind.dpatch kerneis, 2010-11-05.09:48:50 text/x-darcs-patch
unnamed kerneis, 2010-11-04.14:20:01
unnamed kerneis, 2010-11-05.09:48:50
unnamed kerneis, 2010-11-05.10:22:44
See mailing list archives for discussion on individual patches.
Messages
msg12903 (view) Author: kerneis Date: 2010-11-04.14:20:01
Hi,

I discussed the following patch on IRC with Florent.  We both agree it
would be a good thing to do in the long-term, but a collective effort is
required to fix every warning.  Of course, the idea is to try and
understand each warning, not blindly adding "_ <-" to shut the down.

See http://bugs.darcs.net/issue1988 for a rationale.

Best regards,
                  Gabriel

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

Thu Nov  4 15:07:04 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * resolve issue1988: enable warn-unused-do-bind
  
  This patch triggers a lot of warnings (343 currently).  Bug hunting
  season is open!
Attachments
msg12920 (view) Author: kerneis Date: 2010-11-05.09:48:50
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@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.
Attachments
msg12921 (view) Author: kerneis Date: 2010-11-05.10:22:44
Just in case people wonder what those "-- Warning" comments are about, mention
them in README.

Gabriel

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

Fri Nov  5 11:15:36 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * Explain do-notation comments in README
Attachments
msg13023 (view) Author: ganesh Date: 2010-11-14.15:00:56
I'm going to accept this, as I think it makes sense on balance and there's 
been time for people who are opposed to shout.
msg13189 (view) Author: ganesh Date: 2010-11-21.22:25:12
I've applied this now, after amending it to be up to date with the current 
HEAD. I hope the amendment doesn't cause you any disruption, but under the 
circumstances of a patch that was semi-automatically generated anyway it 
seemed like the nicest thing to do.
msg13192 (view) Author: darcswatch Date: 2010-11-21.22:31:45
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2c1ed5a13772b987aabba1a0f30709a0af91f95e
msg14302 (view) Author: darcswatch Date: 2011-05-10.21:05:50
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-2c1ed5a13772b987aabba1a0f30709a0af91f95e
History
Date User Action Args
2010-11-04 14:20:01kerneiscreate
2010-11-04 14:21:10darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-cb98b928ce81a2e4ccfcd21434665f0d9e539629
2010-11-05 09:48:51kerneissetfiles: + resolve-issue1988_-enable-warn_unused_do_bind.dpatch, unnamed
messages: + msg12920
2010-11-05 09:49:55darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-cb98b928ce81a2e4ccfcd21434665f0d9e539629 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-66a37073aa05c0797af123cf27e44c15a34f3df5
2010-11-05 10:22:44kerneissetfiles: + explain-do_notation-comments-in-readme.dpatch, unnamed
messages: + msg12921
2010-11-05 10:23:45darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-66a37073aa05c0797af123cf27e44c15a34f3df5 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2c1ed5a13772b987aabba1a0f30709a0af91f95e
2010-11-07 19:41:02kerneissetfiles: - resolve-issue1988_-enable-warn_unused_do_bind.dpatch
2010-11-14 15:00:56ganeshsetstatus: needs-screening -> accepted-pending-tests
messages: + msg13023
2010-11-21 22:25:13ganeshsetstatus: accepted-pending-tests -> accepted
messages: + msg13189
2010-11-21 22:31:45darcswatchsetmessages: + msg13192
2011-05-10 19:37:48darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2c1ed5a13772b987aabba1a0f30709a0af91f95e -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-66a37073aa05c0797af123cf27e44c15a34f3df5
2011-05-10 21:05:50darcswatchsetmessages: + msg14302
2011-05-10 22:36:33darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-66a37073aa05c0797af123cf27e44c15a34f3df5 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-cb98b928ce81a2e4ccfcd21434665f0d9e539629