This repository was archived by the owner on Sep 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
62 lines (49 loc) · 1.82 KB
/
justfile
File metadata and controls
62 lines (49 loc) · 1.82 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
set dotenv-load
init:
@pip install -r requirements.txt >/dev/null 2>&1
generate-requirements:
@pip freeze > requirements.txt
confirm_setup:
if [ "$(which direnv)" == "" ]; then
echo "direnv is not installed"
fi
test: init
#!/usr/bin/env sh
if [ "$GITHUB_TOKEN" == "" ]; then
echo "❗❗❗ Your GitHub Personal Access Token is not set. Some tests might fail"
echo "Visit https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token"
echo "And then run:"
echo "just set-gh-token"
fi
python -m pytest -s --token ${GITHUB_TOKEN:-"GH PAC is not set"}
coverage: init
@python -m coverage report --omit="*/test*"
coverage-html: init
@python -m coverage html --omit="*/test*"
lint: init
@python -m pylint src --disable=E0401
prospector: init
@python -m prospector
set-gh-token:
#!/usr/bin/env sh
echo "Enter your GH Personal Access Token:"
read token
echo "export GITHUB_TOKEN=$token" > .env
pull-template:
#!/usr/bin/env sh
git remote add template https://github.com/fmipython/assignment-3-template 2>/dev/null
git fetch --all
if git diff --exit-code &>/dev/null && git diff --staged --exit-code &>/dev/null; then
echo "Creating a commit with all current changes as backup"
git add --all
git commit -m "Checkpoint before merging template"
fi
if git merge template/main --allow-unrelated-histories -m 'Merge template' --quiet &>/dev/null; then
echo "Merge conflicts occurred, resolving coflicts"
git checkout src* --ours &>/dev/null
git checkout tests* --theirs &>/dev/null
git checkout justfile --theirs &>/dev/null
git add --all
git merge --continue &>/dev/null
fi
echo "Merge with template completed"