Generate per-person worklogs for language meta projects

parent 0c3c5592
......@@ -95,8 +95,13 @@ reports/%.pdf: reports/%.md
--metadata lang=$(call lang4,$(LANGUAGE)) \
-t latex \
--pdf-engine=xelatex \
-V "mainfont:Libertinus Serif" \
-V "documentclass:scrreprt" \
-V "geometry:landscape" \
-V "geometry:hmargin=2cm" \
-V "geometry:vmargin=3cm" \
-V "pagestyle:headings" \
-V "mainfont:Libertinus Serif" \
-V "sansfont:Libertinus Sans" \
$< -o $@
reports/worklog.md: repository-worklog.md
......
......@@ -38,14 +38,37 @@ BOOKMANIFESTS := $(foreach BOOK,$(BOOKS),book_$(BOOK)__$(_book)_$(BOOK)-manifest
.PHONY: language $(BOOKMANIFESTS)
language: $(BOOKMANIFESTS)
stats: reports/progress.pdf
stats: reports/progress.pdf reports/language-worklong.pdf
combined-worklogs.sqlite: repository-worklog.sqlite $(foreach SUBMODULE,$(SUBMODULES),$(SUBMODULE)/repository-worklog.sqlite)
sqlite3 $@ 'DROP TABLE IF EXISTS commits; CREATE TABLE commits (sha TEXT, author TEXT, date DATE, file TEXT, added INT, removed INT)'
for db in $(filter %.sqlite,$^); do
sqlite3 $${db} .dump
done | sqlite3 $@
done |
grep '^INSERT' |
sqlite3 $@
reports/translations-worklog.md: combined-worklogs.sqlite
now=$$(LANG=en_US date +%c)
ver=$(call versioninfo,$(PROJECT))
export IFS='|'
sqlite3 $< "SELECT DISTINCT(author) FROM commits" |
while read author; do
echo "\n# $${author} Worklog"
echo "Report Generated\n: $${now}\n"
echo "Repository Version\n: $${ver}\n"
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) FROM commits WHERE author='$${author}'" |
while read month; do
echo "\n## $$(LANG=en_US date +'%B %Y' -d $${month}-01)"
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv $< "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}' GROUP BY Filename"
echo '```'
echo -n "Net Characters Added\n: "
sqlite3 $< "SELECT SUM(added+ -removed) FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}'"
done
done |
$(PANDOC) $(PANDOCARGS) -F pantable -o $@
reports/progress.md: $(CCMTOOLKITDIR)/languages.yml $$(newcommits)
mkdir -p $(dir $@)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment