From d7f5b577bc9a9a1e7ad4806d182977a8bb1e50f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 24 Aug 2021 16:03:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/docs-live.sh | 5 +++++ scripts/format.sh | 6 ++++++ scripts/lint.sh | 9 +++++++++ scripts/publish.sh | 5 +++++ scripts/test-cov-html.sh | 7 +++++++ scripts/test-files.sh | 7 +++++++ scripts/test.sh | 8 ++++++++ 7 files changed, 47 insertions(+) create mode 100755 scripts/docs-live.sh create mode 100755 scripts/format.sh create mode 100755 scripts/lint.sh create mode 100755 scripts/publish.sh create mode 100755 scripts/test-cov-html.sh create mode 100755 scripts/test-files.sh create mode 100755 scripts/test.sh diff --git a/scripts/docs-live.sh b/scripts/docs-live.sh new file mode 100755 index 0000000..5342a9e --- /dev/null +++ b/scripts/docs-live.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +mkdocs serve --dev-addr 127.0.0.1:8008 diff --git a/scripts/format.sh b/scripts/format.sh new file mode 100755 index 0000000..0d45639 --- /dev/null +++ b/scripts/format.sh @@ -0,0 +1,6 @@ +#!/bin/sh -e +set -x + +autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place sqlmodel docs_src tests --exclude=__init__.py +black sqlmodel tests docs_src +isort sqlmodel tests docs_src diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..4191d90 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e +set -x + +mypy sqlmodel +flake8 sqlmodel tests docs_src +black sqlmodel tests docs_src --check +isort sqlmodel tests docs_src scripts --check-only diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 0000000..7a9a127 --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +python -m poetry publish --build diff --git a/scripts/test-cov-html.sh b/scripts/test-cov-html.sh new file mode 100755 index 0000000..b15445f --- /dev/null +++ b/scripts/test-cov-html.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e +set -x + +bash ./scripts/test.sh +coverage html diff --git a/scripts/test-files.sh b/scripts/test-files.sh new file mode 100755 index 0000000..36579ce --- /dev/null +++ b/scripts/test-files.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e +set -x + +# Check README.md is up to date +diff --brief docs/index.md README.md diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..139c1fb --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +set -x + +coverage run -m pytest tests +coverage combine +coverage report --show-missing