%.html/view: %.html
sensible-browser $*.html
-HLint.hs: $(shell find . -name '*.hs' -not -name 'HLint.hs')
- sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
- echo '-- BEGIN: generated hints' >> HLint.hs
- hlint --find . | sed -ne 's/^- infix: \(.*\)/\1/p' | sort -u >>HLint.hs
- echo '-- END: generated hints' >> HLint.hs
+.hlint.yaml: $(shell find src -name '*.hs' -not -name 'HLint.hs')
+ sed -i -e '/^# BEGIN: generated hints/,/^# END: Generated by hlint/d' $@
+ echo >>$@ '# BEGIN: generated hints'
+ hlint --find . | grep -- '- fixity:' | sort -u >>$@
+ echo >>$@ '# END: generated hints'
-lint: HLint.hs
- if hlint --quiet --report=hlint.html -XNoCPP \
- $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$(cabal)) $(HLINT_FLAGS) .; \
+lint: .hlint.yaml
+ if hlint --quiet --report=hlint.html -XNoCPP $(HLINT_FLAGS) .; \
then rm -f hlint.html; \
else sensible-browser ./hlint.html & fi