Skip to content

Commit 0f6e9a9

Browse files
committed
🔨 Add scripts to test and lint
1 parent 0cf93b3 commit 0f6e9a9

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

scripts/format.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh -e
2+
set -x
3+
set -e
4+
5+
ruff src tests scripts --fix
6+
ruff format src tests scripts

scripts/lint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
mypy src tests scripts
7+
ruff check src tests scripts
8+
ruff format src tests --check

scripts/test-cov-html.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
bash scripts/test.sh --cov-report=html ${@}

scripts/test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
# For tests, a large terminal width
7+
export TERMINAL_WIDTH=3000
8+
# Force disable terminal for tests inside of pytest, takes precedence over GITHUB_ACTIONS env var
9+
export _TYPER_FORCE_DISABLE_TERMINAL=1
10+
# It seems xdist-pytest ensures modified sys.path to import relative modules in examples keeps working
11+
pytest --cov --cov-report=term-missing -o console_output_style=progress --numprocesses=auto ${@}

0 commit comments

Comments
 (0)