pkuthss/utils/qa
Casper Ti. Vector 1934ffc04d Add appropriate copyright notices.
Add indentation modelines.
Use tabs in `pkuthss.bib'.
`thanks.tex' -> `acknowledge.tex'
2012-05-18 12:44:56 +08:00

50 lines
1.8 KiB
Makefile
Executable File

#!/usr/bin/make -f
# vim:ts=4:sw=4
#
# Copyright (c) 2012 Casper Ti. Vector
# Public domain.
FIND_GBK = '(' -name '*gbk*' -o -name '*.bat*' ')'
FIND_CRLF = -name '*.bat*'
FIND_VCS = '(' -type d -name '.git' -prune ')'
# IGNORE "error"s intentionally.
.IGNORE qa: enc lt sync spell tail
enc:
@echo '======================================================================'
@echo '$@: check file encodings'
@echo '======================================================================'
find . -not $(FIND_VCS) $(FIND_GBK) \
-type f -exec file '{}' '+' | grep -vE 'GB|ISO-8859|ASCII'
find . -not $(FIND_VCS) -not $(FIND_GBK) \
-type f -exec file '{}' '+' | grep -E 'GB|ISO-8859'
lt:
@echo '======================================================================'
@echo '$@: check line terminators'
@echo '======================================================================'
find . -not $(FIND_VCS) $(FIND_CRLF) \
-type f -exec file '{}' '+' | grep -vE 'CRLF'
find . -not $(FIND_VCS) -not $(FIND_CRLF) \
-type f -exec file '{}' '+' | grep -E 'CRLF'
sync:
@echo '======================================================================'
@echo '$@: keep GBK and UTF-8 files synchronised'
@echo '======================================================================'
iconv -f GBK tex/pkuthss-gbk.def | diff - tex/pkuthss-utf8.def
spell:
@echo '======================================================================'
@echo '$@: use "模版" instead of "模板"'
@echo '======================================================================'
grep -r '模板' .
tail:
@echo '======================================================================'
@echo '$@: remember to update documentation after modifications'
@echo '$@: remember to review `git diff`'
@echo '======================================================================'