-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathproject-config
executable file
·64 lines (47 loc) · 1.39 KB
/
project-config
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
#!/usr/bin/env bash
# A simple configuration file for my vim session
# This file sets up the Makefile and the ENV vars for my vim config.
# Fake `realpath` when it doesn't exist. This only really happens on
# GitHub actions' MacOS runner, since the system does not come with
# a realpath implementation by default, though it can be installed
# using `brew`.
if ! command -v realpath &> /dev/null
then
realpath() {
echo $PWD
}
fi
generate_makefile() {
echo "\
# This file is generated by \`. project-config\`. Any changes made here are overwritten.
.PHONY: all test cover
PROJECT = $VIM_PROJNAME
install:
pip3 install -e .
all:
make install format lint list-todo
format:
isort \$(PROJECT) && black \$(PROJECT)
lint:
pylint \$(PROJECT)
lint-prose:
python3 utils/lint_prose.py
type:
mypy \$(PROJECT)
list-todo:
python3 utils/list_todos.py \"\`grep -rnw . -e '# TODO'\`\"
test:
pytest --cov='./pytermgui'
cover:
coverage html
test-cov:
make test cover
docs:
pdoc --logo https://github.com/bczsalba/pytermgui/blob/master/assets/title.png?raw=true --docformat google -o docs pytermgui" > $VIM_PROJPATH/Makefile
}
export VIM_PROJNAME="pytermgui"
export VIM_PROJPATH="$(realpath `dirname $BASH_SOURCE`)"
# export VIM_COMMAND="python3 $VIM_PROJPATH/sandbox/.py"
# export VIM_NOTES="$VIM_PROJPATH/notes.md"
generate_makefile
echo "Set up project \"$VIM_PROJNAME\" at path \"$VIM_PROJPATH\"."