pre-commit 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # yamify - define family trees in YAML
  3. #
  4. # Copyright (C) 2020 Fabian Peter Hammerle <fabian@hammerle.me>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. if ! git diff --quiet --exit-code; then
  19. git status
  20. echo
  21. echo unstaged changes
  22. exit 1
  23. fi
  24. set -ex
  25. pipenv clean
  26. pipenv sync --dev
  27. pipenv run black --check
  28. pipenv run pylint yamily tests/*
  29. pipenv run pytest --cov=yamily --cov-report=term-missing --cov-fail-under=100
  30. pipenv run python -m doctest README.md