Skip to content

Commit bbe1da9

Browse files
committed
feat: add mypy for type checking
1 parent cdb45a1 commit bbe1da9

File tree

6 files changed

+77
-15
lines changed

6 files changed

+77
-15
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Checkout (GitHub)
1313
uses: actions/checkout@v4
1414

15-
- name: Build and run dev container tests
15+
- name: Run quality checks
1616
uses: devcontainers/ci@v0.3
1717
with:
18-
runCmd: ./run_tests_and_bandit.sh
18+
runCmd: ./quality_checks.sh

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Our template ensures a streamlined development lifecycle, offering:
8383
- **Structured Logging with Loguru**: Enhanced debugging and monitoring.
8484
- **Best Practice Configuration**: Using `pydantic-settings`.
8585
- **Efficient Deployment**: Smooth deployment to Posit Connect with `rsconnect`.
86+
- **Static Type Checking with mypy**: Ensures type safety and code quality.
8687

8788
## Community and Contributions
8889

poetry.lock

Lines changed: 59 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ tenacity = "^8.2.3"
3232
bandit = "^1.7.8"
3333
pytest-watch = "^4.2.0"
3434
pytest-cov = "^5.0.0"
35+
mypy = "^1.9.0"
3536

3637
[build-system]
3738
requires = ["poetry-core"]

quality_checks.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# This script is for running quality checks in GitHub Actions.
3+
# It runs tests, security analysis with Bandit, and type checks with mypy.
4+
5+
set -e # Exit immediately if a command exits with a non-zero status.
6+
7+
echo "Running pytest for unit tests..."
8+
poetry run pytest
9+
10+
echo "Running Bandit for security analysis..."
11+
poetry run bandit -r pyshiny_template
12+
13+
echo "Running mypy for type checking..."
14+
poetry run mypy pyshiny_template

run_tests_and_bandit.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)