Skip to content

Commit

Permalink
Add script to validate test docstrings
Browse files Browse the repository at this point in the history
Closes #46
  • Loading branch information
elyezer committed Oct 6, 2017
1 parent 3cc7ca6 commit 35f1c8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ test-coverage:
py.test --verbose --cov-report term --cov=camayoc.cli --cov=camayoc.config --cov=camayoc.exceptions --cov=camayoc.utils tests

validate-docstrings:
@./scripts/validate_docstrings.sh
@testimony --tokens $(TESTIMONY_TOKENS) --minimum-tokens $(TESTIMONY_MINIMUM_TOKENS) validate camayoc/tests

.PHONY: all docs-clean docs-html install install-dev lint package \
Expand Down
13 changes: 13 additions & 0 deletions scripts/validate_docstrings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

DUPLICATED_IDS=$(
grep -r -i --include "*.py" :id: camayoc/tests | sort -k 2 | uniq -d -f 2)

if [ "${DUPLICATED_IDS}" ]; then
echo "Found duplicated test case IDs:"
echo
echo -n "${DUPLICATED_IDS}"
echo
exit 1
fi

0 comments on commit 35f1c8e

Please sign in to comment.