Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions base.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ NPM ?= $(shell command -v yarn 2> /dev/null)
NODE_BINDIR ?= $(shell $(NPM) bin)
### Commands (from `NODE_BINDIR` via `PATH` environment variable)
JEST ?= jest
PRETTIER ?= prettier
# Set PATH to node binaries
export PATH := $(NODE_BINDIR):$(PATH)
endif
Expand Down Expand Up @@ -165,7 +166,7 @@ ifneq ($(STAGED_JINJA_FILES),)
@$(DJLINT) $(STAGED_JINJA_FILES) --lint
endif
ifneq (,$(STAGED_NODE_FILES))
@prettier --write $(STAGED_NODE_FILES)
@$(PRETTIER) --write $(STAGED_NODE_FILES)
endif
@FORMATTED_FILES=`git diff --name-only $(STAGED_PYTHON_FILES) $(STAGED_JINJA_FILES) $(STAGED_NODE_FILES)`; if [[ "$$FORMATTED_FILES" ]]; then \
echo; \
Expand All @@ -184,7 +185,11 @@ endif
#
DOT_FILES ?= MakeCitron.Makefile .sass-lint.yml
PYTHON_DOT_FILES ?= pyproject.toml setup.cfg
NODE_DOT_FILES ?= .eslintrc.json .eslintignore .prettierrc .prettierignore jsconfig.json
PRETTIER_DOT_FILES :=
ifeq ($(PRETTIER),prettier)
PRETTIER_DOT_FILES := .prettierrc .prettierignore
endif
NODE_DOT_FILES ?= .eslintrc.json .eslintignore $(PRETTIER_DOT_FILES) jsconfig.json
ifdef _NODE
DOT_FILES += $(NODE_DOT_FILES)
endif
Expand Down Expand Up @@ -228,7 +233,7 @@ endif

install-nod%: ## install-node: Install node dependencies for development
$(LOG)
yarn install --production=false --check-files
$(NPM) install --production=false --check-files
rm -fr .eslintcache

requirements/%.txt: requirements/%.in ## requirements/%.txt: Generate python requirements
Expand Down Expand Up @@ -352,7 +357,7 @@ fix-pytho%: ## fix-python: Fix python source format and lint violations

fix-nod%: ## fix-node: Fix node source format
$(LOG)
prettier --write '{,lib/**/}*.js?(x)'
$(PRETTIER) --write '{,lib/**/}*.js?(x)'

fi%: least-specific-fix ## fix: Fix all source format
$(LOG)
Expand Down