-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.23 KB
/
Makefile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Variables
PROJECT_NAME = nvim
PYTHON = python3
ROOT_DIR := $(CURDIR)
SHELL := /bin/bash
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)
.PHONY: all
all: help
## Init:
.PHONY: init
init: direnv vale pre-commit-init ## initialize environment
.PHONY: direnv
direnv: ## setup direnv for env
cp .envrc.sample .envrc && direnv allow .
.PHONY: vale
vale: ## setup vale
vale sync --config .vale.ini
.PHONY: pre-commit-init
pre-commit-init: ## install pre-commit
pre-commit install
## Lint:
.PHONY: lint
lint: pre-commit ## Run linters
.PHONY: pre-commit
pre-commit: ## Run pre-commit
pre-commit run -a
## Docs:
.PHONY: gen-docs
gen-docs: ## Run scripts/gen-nvim-plugin-catalog.py
uv run scripts/gen-nvim-plugin-catalog.py
## Help:
.PHONY: help
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
}' $(MAKEFILE_LIST)