Workaround hlint behaviour with no warnings/errors
authorIustin Pop <iustin@google.com>
Thu, 7 Feb 2013 13:32:49 +0000 (14:32 +0100)
committerIustin Pop <iustin@google.com>
Thu, 7 Feb 2013 16:14:34 +0000 (17:14 +0100)
When hlint sees a perfectly nice code tree, it will skip generating
the reports (both stdout and html). This means that usually the old
report will remain in place, so it makes development harder, as the
html file is out of sync with the tree.

To workaround this, we generate an empty/minimal file in this case.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

Makefile.am

index 3657d7b..2b20bf0 100644 (file)
@@ -1699,6 +1699,7 @@ HLINT_EXCLUDES = src/Ganeti/THH.hs test/hs/hpc-htools.hs
 .PHONY: hlint
 hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
        @test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
+       @rm -f doc/hs-lint.html
        if tty -s; then C="-c"; else C=""; fi; \
        $(HLINT) --utf8 --report=doc/hs-lint.html --cross $$C \
          --ignore "Use first" \
@@ -1707,6 +1708,9 @@ hlint: $(HS_BUILT_SRCS) src/lint-hints.hs
          --ignore "Reduce duplication" \
          --hint src/lint-hints \
          $(filter-out $(HLINT_EXCLUDES),$(HS_LIBTEST_SRCS) $(HS_PROG_SRCS))
+       @if [ ! -f doc/hs-lint.html ]; then \
+         echo "All good" > doc/hs-lint.html; \
+       fi
 
 # a dist hook rule for updating the vcs-version file; this is
 # hardcoded due to where it needs to build the file...