mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-24 14:50:38 +01:00
htdocs.mk: Run linters prettier and php -l with all target
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
b181f76343
commit
eb22977054
1 changed files with 31 additions and 1 deletions
|
|
@ -5,9 +5,12 @@ LESS_CPY ?= lesscpy
|
||||||
include $(JWBDIR)/make/defs.mk
|
include $(JWBDIR)/make/defs.mk
|
||||||
|
|
||||||
# -- HTML
|
# -- HTML
|
||||||
|
PRETTIER := $(shell $(WHICH) prettier 2>/dev/null)
|
||||||
INSTALLATION_FILE_TYPES += HTML
|
INSTALLATION_FILE_TYPES += HTML
|
||||||
BUILD_HTMLDIR = $(TOPDIR)/htdocs
|
BUILD_HTMLDIR = $(TOPDIR)/htdocs
|
||||||
LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES))
|
LOCAL_HTML += $(filter-out $(DONT_INSTALL),$(wildcard *.html *.css *.php *.js) $(FONTS) $(IMAGES))
|
||||||
|
DONT_LINT_HTML += $(shell $(ECHO) $(wildcard *.html) | xargs --no-run-if-empty $(GREP) -l '<?php')
|
||||||
|
LOCAL_HTML_LINT ?= $(addprefix .,$(addsuffix .lint,$(filter-out $(DONT_LINT_HTML),$(wildcard *.html *.php *.css *.js))))
|
||||||
ifeq ($(HTML_SUBDIR),)
|
ifeq ($(HTML_SUBDIR),)
|
||||||
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/htdocs\(\/\|$$\)/!d; s%.*/htdocs\(/\|$$\)%%')
|
HTML_SUBDIR := $(shell $(PWD) | $(SED) '/.*\/htdocs\(\/\|$$\)/!d; s%.*/htdocs\(/\|$$\)%%')
|
||||||
endif
|
endif
|
||||||
|
|
@ -23,7 +26,7 @@ include $(JWBDIR)/make/js.mk
|
||||||
include $(JWBDIR)/make/rules.mk
|
include $(JWBDIR)/make/rules.mk
|
||||||
include $(JWBDIR)/make/dev-utils.mk
|
include $(JWBDIR)/make/dev-utils.mk
|
||||||
|
|
||||||
all: $(LESS_GENERATED_CSS)
|
all: $(LESS_GENERATED_CSS) lint
|
||||||
install: install_HTML
|
install: install_HTML
|
||||||
clean: textclean localclean doneclean clean.lesscpy
|
clean: textclean localclean doneclean clean.lesscpy
|
||||||
test:
|
test:
|
||||||
|
|
@ -34,3 +37,30 @@ test:
|
||||||
|
|
||||||
clean.lesscpy:
|
clean.lesscpy:
|
||||||
$(RM) -f $(LESS_GENERATED_CSS) *.tmp
|
$(RM) -f $(LESS_GENERATED_CSS) *.tmp
|
||||||
|
|
||||||
|
lint: $(LOCAL_HTML_LINT)
|
||||||
|
clean: lint.clean
|
||||||
|
lint.clean:
|
||||||
|
rm -f .*.lint
|
||||||
|
|
||||||
|
.%.html.lint: %.html
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.php.lint: %.php
|
||||||
|
php -l $<
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.css.lint: %.css
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
.%.js.lint: %.js
|
||||||
|
ifneq ($(PRETTIER),)
|
||||||
|
$(PRETTIER) $< >/dev/null
|
||||||
|
endif
|
||||||
|
touch $@
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue