...

Text file src/moul.io/http2curl/v2/tool/lint/Makefile

Documentation: moul.io/http2curl/v2/tool/lint

     1rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
     2my-filter-out = $(foreach v,$(2),$(if $(findstring $(1),$(v)),,$(v)))
     3testfiles ?= $(sort $(call my-filter-out,node_modules/,$(call rwildcard,../..,*.md)))
     4
     5all: test
     6
     7test: info offensive-wording remark markdownlint spellcheck
     8	@echo ""
     9	@echo "--- OK. ---"
    10.PHONY: test
    11
    12info: deps
    13	@echo ""
    14	@echo "==> Files to check:"
    15	@echo "  $(testfiles:../.%=%)"
    16.PHONY: info
    17
    18offensive-wording: deps
    19	@echo ""
    20	@echo "==> Checking for inconsiderate/insensitive wording..."
    21	@node_modules/.bin/alex --diff $(testfiles) || true
    22.PHONY: offensive-wording
    23
    24spellcheck: deps
    25	@echo ""
    26	@echo "==> Checking for spelling errors..."
    27	@node_modules/.bin/mdspell --report --en-us --ignore-numbers --ignore-acronyms $(testfiles)
    28.PHONY: spellcheck
    29
    30remark: deps
    31	@echo ""
    32	@echo "==> Checking for messy formatting..."
    33	@node_modules/.bin/remark --frail $(testfiles)
    34.PHONY: remark
    35
    36markdownlint: deps
    37	@echo ""
    38	@echo "==> Checking for good practices..."
    39	@node_modules/.bin/markdownlint $(testfiles)
    40.PHONY: markdownlint
    41
    42deps: node_modules/
    43node_modules/: package.json
    44	npm install
    45	touch $@
    46.PHONY: deps

View as plain text