-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (98 loc) · 2.3 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.DEFAULT_GOAL := help
today = $(shell date "+%Y%m%d")
product_name = generate-readme.nvim
gpg_pub_key = CCAA9E0638DF9088BB624BC37C0F8AD3FB3938FC
## Create a patch and copy it to windows
.PHONY : patch
patch : clean diff-patch copy2win-patch
## Create a GPG-encrypted patch and copy it to Windows
.PHONY : gpg-patch
gpg-patch : clean diff-patch-gpg copy2win-patch-gpg
## Create a patch
.PHONY : diff-patch-raw
diff-patch-raw :
bash utils/create-patch.sh
## Create a GPG-encrypted patch
.PHONY : diff-patch-gpg
diff-patch-gpg :
echo "THIS IS WIP"
#bash utils/create-patch.sh --use-gpg
#git diff origin/master | gpg --encrypt --recipient $(gpg_pub_key) > $(product_name).$(today).patch.gpg
## Create a patch
.PHONY : diff-patch
diff-patch : diff-patch-raw
## Create a patch branch
.PHONY : patch-branch
patch-branch :
git switch -c patch-$(today)
## Switch to master branch
.PHONY : switch-master
switch-master :
git switch master
## Delete patch branch
.PHONY : delete-branch
delete-branch : clean switch-master
git branch --list "patch*" | xargs -n 1 git branch -D
## Run clean
.PHONY : clean
clean :
bash utils/clean.sh
## Copy patch to Windows
.PHONY : copy2win-patch-raw
copy2win-patch-raw :
cp *.patch $$WIN_HOME/Downloads/
## Copy GPG-encrypted patch to Windows
.PHONY : copy2win-patch-gpg
copy2win-patch-gpg :
cp *.patch.gpg $$WIN_HOME/Downloads/
## Copy patch to Windows
.PHONY : copy2win-patch
copy2win-patch : copy2win-patch-raw
## Run tests
.PHONY : test
test : lint
## Run lints
.PHONY : lint
lint : selene-lint stylua-lint textlint typo-check shell-lint
## Run stylua lint
.PHONY : stylua-lint
stylua-lint :
stylua --check ./
## Run selene
.PHONY : selene-lint
selene-lint :
selene .
## Run textlint
.PHONY : textlint
textlint :
pnpm run textlint
## Run typos
.PHONY : typo-check
typo-check :
typos .
## Run shellcheck
.PHONY : shell-lint
shell-lint :
bash utils/lint.sh
## Run format
.PHONY : fmt
fmt : format
## Run format
.PHONY : format
format : stylua-format shell-format
## Run stylua format
.PHONY : stylua-format
stylua-format :
stylua ./
## Run shfmt
.PHONY : shell-format
shell-format :
bash utils/format.sh
## Add commit message up to `origin/master` to CHANGELOG.md
.PHONY : changelog
changelog :
bash utils/changelog.sh
## Show help
.PHONY : help
help :
@make2help $(MAKEFILE_LIST)