Cleanup hlint errors
First, we update the recommended hlint version to what I used to get a clean output (1.8.15). Most of the changes are: - remove unneeded parentheses - some simplifications (intercalate " " → unwords, maybe … id → fromMaybe, etc.) - removal of some duplicate code (in previous patches) There are still some warnings which I didn't clean out but plain ignored: - 'Eta reduce' in some specific files, because the type inference specialises the function on the first call, and annotating the type properly would be too verbose - use of 'first', 'comparing', and 'on', since these don't seem to be widely or consistently used (outside ganeti/htools, I mean) - use of Control.Exception.catch, as we only care about I/O errors; at one point yes, we will need to transition to this new API - 'Reduce duplication', since hlint warns even for 3 duplicate lines, and abstracting that away seems overkill to me After this patch, make hlint is clean and doesn't exit with an error anymore; we could enable it automatically on 'make lint' if hlint is detected (future patch). Note that we explicitly skip the THH.hs file from checking because it seems that hlint doesn't parse correctly for now the splice notation. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Agata Murawska <agatamurawska@google.com>
Showing
- Makefile.am 7 additions, 1 deletionMakefile.am
- doc/devnotes.rst 5 additions, 4 deletionsdoc/devnotes.rst
- htools/Ganeti/HTools/CLI.hs 8 additions, 8 deletionshtools/Ganeti/HTools/CLI.hs
- htools/Ganeti/HTools/Cluster.hs 5 additions, 5 deletionshtools/Ganeti/HTools/Cluster.hs
- htools/Ganeti/HTools/ExtLoader.hs 13 additions, 16 deletionshtools/Ganeti/HTools/ExtLoader.hs
- htools/Ganeti/HTools/IAlloc.hs 22 additions, 19 deletionshtools/Ganeti/HTools/IAlloc.hs
- htools/Ganeti/HTools/Loader.hs 3 additions, 4 deletionshtools/Ganeti/HTools/Loader.hs
- htools/Ganeti/HTools/Luxi.hs 19 additions, 16 deletionshtools/Ganeti/HTools/Luxi.hs
- htools/Ganeti/HTools/Node.hs 1 addition, 2 deletionshtools/Ganeti/HTools/Node.hs
- htools/Ganeti/HTools/Program/Hail.hs 2 additions, 1 deletionhtools/Ganeti/HTools/Program/Hail.hs
- htools/Ganeti/HTools/Program/Hbal.hs 30 additions, 30 deletionshtools/Ganeti/HTools/Program/Hbal.hs
- htools/Ganeti/HTools/Program/Hspace.hs 9 additions, 10 deletionshtools/Ganeti/HTools/Program/Hspace.hs
- htools/Ganeti/HTools/QC.hs 33 additions, 30 deletionshtools/Ganeti/HTools/QC.hs
- htools/Ganeti/HTools/Rapi.hs 19 additions, 16 deletionshtools/Ganeti/HTools/Rapi.hs
- htools/Ganeti/HTools/Text.hs 3 additions, 2 deletionshtools/Ganeti/HTools/Text.hs
- htools/Ganeti/Luxi.hs 12 additions, 12 deletionshtools/Ganeti/Luxi.hs
- htools/test.hs 20 additions, 20 deletionshtools/test.hs
Loading
Please register or sign in to comment