forked from nierdz/wordpress-opcache-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (31 loc) · 1.14 KB
/
Copy pathMakefile
File metadata and controls
41 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
MAIN_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
VIRTUALENV_DIR := $(MAIN_DIR)/venv
VIRTUAL_ENV_DISABLE_PROMPT = true
PATH := $(VIRTUALENV_DIR)/bin:vendor/bin:$(PATH)
SHELL := /usr/bin/env bash
.DEFAULT_GOAL := help
.SHELLFLAGS := -eu -o pipefail -c
export PATH
help: ## Print this help
@grep -E '^[a-zA-Z1-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN { FS = ":.*?## " }; { printf "\033[36m%-30s\033[0m %s\n", $$1, $$2 }'
$(VIRTUALENV_DIR):
virtualenv -p $(shell command -v python3) $(VIRTUALENV_DIR)
$(VIRTUALENV_DIR)/bin/pre-commit: $(MAIN_DIR)/requirements.txt
pip install -r $(MAIN_DIR)/requirements.txt
@touch '$(@)'
pre-commit-install: ## Install pre-commit hooks
pre-commit install
install-pip-packages: $(VIRTUALENV_DIR) $(VIRTUALENV_DIR)/bin/pre-commit ## Install python pip packages in a virtual environment
install: install-pip-packages composer-install ## Install everything
composer-install: ## Install composer packages
composer install
tests: ## Run all phpcs tests
phpcs \
-v \
-s \
--ignore=flush-opcache/vendor \
--standard=WordPress \
flush-opcache/
pre-commit run --all-files