Remove use of 'head' and add hlint warning for it
Since 'head' is unsafe to use in most cases, this patch removes its use from most of the code, adds a lint warning for it (and for tail as well), and adds override annotations in the few cases where it's actually OK to use it (mainly when using head over the result of functions which guarantee to return a non-empty list by documentation, not type). Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Helga Velroyen <helgav@google.com>
Showing
- src/Ganeti/HTools/Backend/IAlloc.hs 8 additions, 8 deletionssrc/Ganeti/HTools/Backend/IAlloc.hs
- src/Ganeti/HTools/Backend/Luxi.hs 5 additions, 5 deletionssrc/Ganeti/HTools/Backend/Luxi.hs
- src/Ganeti/HTools/Backend/Rapi.hs 4 additions, 4 deletionssrc/Ganeti/HTools/Backend/Rapi.hs
- src/Ganeti/HTools/Cluster.hs 7 additions, 8 deletionssrc/Ganeti/HTools/Cluster.hs
- src/Ganeti/HTools/Graph.hs 2 additions, 1 deletionsrc/Ganeti/HTools/Graph.hs
- src/Ganeti/HTools/Node.hs 4 additions, 1 deletionsrc/Ganeti/HTools/Node.hs
- src/Ganeti/HTools/Program/Hail.hs 5 additions, 3 deletionssrc/Ganeti/HTools/Program/Hail.hs
- src/Ganeti/HTools/Program/Hbal.hs 6 additions, 5 deletionssrc/Ganeti/HTools/Program/Hbal.hs
- src/Ganeti/HTools/Program/Hspace.hs 12 additions, 3 deletionssrc/Ganeti/HTools/Program/Hspace.hs
- src/Ganeti/Query/Server.hs 5 additions, 2 deletionssrc/Ganeti/Query/Server.hs
- src/Ganeti/Utils.hs 13 additions, 0 deletionssrc/Ganeti/Utils.hs
- src/lint-hints.hs 6 additions, 0 deletionssrc/lint-hints.hs
- test/hs/Test/Ganeti/Common.hs 4 additions, 1 deletiontest/hs/Test/Ganeti/Common.hs
- test/hs/Test/Ganeti/HTools/Container.hs 5 additions, 3 deletionstest/hs/Test/Ganeti/HTools/Container.hs
- test/hs/Test/Ganeti/JQueue.hs 7 additions, 9 deletionstest/hs/Test/Ganeti/JQueue.hs
- test/hs/Test/Ganeti/Objects.hs 5 additions, 7 deletionstest/hs/Test/Ganeti/Objects.hs
- test/hs/Test/Ganeti/OpCodes.hs 4 additions, 5 deletionstest/hs/Test/Ganeti/OpCodes.hs
- test/hs/Test/Ganeti/TestCommon.hs 10 additions, 1 deletiontest/hs/Test/Ganeti/TestCommon.hs
- test/hs/Test/Ganeti/Utils.hs 7 additions, 1 deletiontest/hs/Test/Ganeti/Utils.hs
Loading
Please register or sign in to comment