-
Notifications
You must be signed in to change notification settings - Fork 2
/
ci
executable file
·37 lines (30 loc) · 963 Bytes
/
ci
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
#!/bin/bash
# check-in script
# safety
set -e
# debugging
# set -x
# static correctness
flake8 --max-line-length=100 --show-source bead bead_cli *.py
git config --get remote.origin.url | {
read origin
# [email protected]:e3krisztian/bead.git
origin=${origin#*github.com?}
origin=${origin%.git}
USER=${origin%/*}
PROJECT=${origin#*/}
# get branch
BRANCH=$(git symbolic-ref --short -q HEAD)
# update TODO section of README.md
TEMPREADME=$(mktemp --tmpdir=. README-TODOS-XXX)
{
sed '0,/^## TODO/p;d' README.md
printf '\nUpdated by script ([./ci](https://github.com/'$USER/$PROJECT/blob/$BRANCH'/ci)), text in this section and afterwards will be overwritten\n\n'
git grep -n -e FIXME -e TODO -e XXX -- '*.py' |
sed 's=^\([^:]*\):\([0-9]*\):[#[:space:]]*\(.*\)=- [\3](https://github.com/'$USER/$PROJECT/blob/$BRANCH'/\1#L\2)=' |
sort
} > "$TEMPREADME"
mv "$TEMPREADME" README.md
}
# check in interactively
git gui