Disallow pushing of new trailing whitespace

Herbert Valerio Riedel hvr at gnu.org
Tue Aug 20 14:55:31 CEST 2013


On 2013-08-20 at 13:21:02 +0200, Geoffrey Mainland wrote:
> How about a third hook that disallows commits that include
> whitespace-only changes unless *all* changes are whitespace-only? ;)

The other two validations were about preserving an invariant ("file has
no tabs" & "file has no trailing whitespace") and more or less simple to
decide; 

...whereas your suggestion seems problematic as it's difficult to know
whether a whitespace change to a Haskell program has semantic meaning;
for example, how should the script detect that the following whitespace
modification...

--- main.hs	2013-08-20 14:53:34.119960468 +0200
+++ main2.hs	2013-08-20 14:53:43.295960294 +0200
@@ -1,5 +1,5 @@
 foo x = do
     putStrLn "foo"
     when x $ do
       putStrLn "bar" 
-      putStrLn "doo"
+    putStrLn "doo"


...is actually a semantic change?

Cheers,
  hvr




More information about the ghc-devs mailing list