-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (29 loc) · 984 Bytes
/
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
# package manager check
# check homebrew, pip3, pip
PM := $(shell { command -v brew || command -v pip3 || command -v pip; } 2> /dev/null)
all: pre_commit bin
# Project initialization succeeded!
bin: # creates the demo protoc plugin for demonstrating uses of PG*
go build -o ./bin/protoc-gen-connection .
pre_commit:
ifeq ($(CI), true)
$(info CI detected, skip install pre-commit.)
else ifeq ($(PM),)
$(error No valid package manager found. Please install brew (macOS) or pip (Linux) and try again.)
else ifeq ($(shell which pre-commit),)
$(info Package manager found: $(PM))
$(info Please make sure the directory which your pre-commit located is in your PATH.)
# Installing pre-commit
@- $(PM) install pre-commit
# Pre-commit installed!
else
$(info Pre-commit installed.)
endif
ifneq ($(CI), true)
# Installing pre-commit hooks
@- pre-commit install
# Pre-commit hooks installed!
endif
lint: pre_commit
@- pre-commit run --all-files
.PHONY: all bin pre_commit lint