Revision 6e4c8f68

b/Makefile.am
1314 1314
# For excluding pep8 expects filenames only, not whole paths
1315 1315
PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES))))
1316 1316

  
1317
LINT_TARGETS = pylint pylint-qa
1318
if HAS_PEP8
1319
LINT_TARGETS += pep8
1320
endif
1321
if HAS_HLINT
1322
LINT_TARGETS += hlint
1323
endif
1324

  
1317 1325
.PHONY: lint
1318
lint: $(BUILT_SOURCES)
1326
lint: $(LINT_TARGETS)
1327

  
1328
.PHONY: pylint
1329
pylint: $(BUILT_SOURCES)
1319 1330
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1320
	if test -z "$(PEP8)"; then \
1321
		echo '"pep8" not found during configure' >&2; \
1322
	else \
1323
		$(PEP8) --repeat --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1324
			$(pep8_python_code); \
1325
	fi
1326 1331
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1332

  
1333
.PHONY: pylint-qa
1334
pylint-qa: $(BUILT_SOURCES)
1335
	@test -n "$(PYLINT)" || { echo 'pylint' not found during configure; exit 1; }
1327 1336
	cd $(top_srcdir)/qa && \
1328 1337
	  PYTHONPATH=$(abs_top_srcdir) $(PYLINT) $(LINT_OPTS) \
1329 1338
	  --rcfile  ../pylintrc $(patsubst qa/%.py,%,$(qa_scripts))
1330 1339

  
1340
.PHONY: pep8
1341
pep8: $(BUILT_SOURCES)
1342
	@test -n "$(PEP8)" || { echo 'pep8' not found during configure; exit 1; }
1343
	$(PEP8) --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1344
		--repeat $(pep8_python_code)
1345

  
1331 1346
.PHONY: hlint
1332 1347
hlint: $(HS_BUILT_SRCS) htools/lint-hints.hs
1348
	@test -n "$(HLINT)" || { echo 'hlint' not found during configure; exit 1; }
1333 1349
	if tty -s; then C="-c"; else C=""; fi; \
1334
	hlint --report=doc/hs-lint.html --cross $$C \
1350
	$(HLINT) --report=doc/hs-lint.html --cross $$C \
1335 1351
	  --ignore "Use first" \
1336 1352
	  --ignore "Use comparing" \
1337 1353
	  --ignore "Use on" \
b/configure.ac
387 387
then
388 388
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
389 389
fi
390
AM_CONDITIONAL([HAS_PEP8], [test "$PEP8"])
390 391

  
391 392
# Check for socat
392 393
AC_ARG_VAR(SOCAT, [socat path])
......
518 519
fi
519 520
AC_SUBST(HTOOLS_APIDOC)
520 521

  
522
# Check for hlint
523
HLINT=no
524
AC_ARG_VAR(HLINT, [hlint path])
525
AC_PATH_PROG(HLINT, [hlint], [])
526
if test -z "$HLINT"; then
527
  AC_MSG_WARN([hlint not found, checking code will not be possible])
528
fi
529

  
521 530
fi # end if enable_htools, define automake conditions
522 531

  
523 532
if test "$HTOOLS" != "yes" && test "$HS_CONFD" = "True"; then
......
528 537
AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
529 538
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$GHC_PKG_QUICKCHECK" != x])
530 539
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
540
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
531 541

  
532 542
# Check for fakeroot
533 543
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])

Also available in: Unified diff