tidy up public repo #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Formatting, Linting, and Type Checking for CLI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| type-check-cli: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: install poetry as a tool | |
| run: uv tool install poetry | |
| - name: install dependencies | |
| run: uvx poetry install --with dev | |
| - name: Run mypy on allowlist | |
| run: uvx poetry run mypy --non-interactive --config-file pyproject.toml @mypy_allowlist.txt | |
| - name: Run ruff check on changed files | |
| run: | | |
| CHANGED_FILES=$(git diff --name-only origin/main -- '*.py') | |
| if [ -n "$CHANGED_FILES" ]; then | |
| uvx ruff check $CHANGED_FILES | |
| else | |
| echo "No Python files changed, skipping lint check." | |
| fi | |
| - name: Run ruff format on changed files | |
| run: | | |
| CHANGED_FILES=$(git diff --name-only origin/main -- '*.py') | |
| if [ -n "$CHANGED_FILES" ]; then | |
| uvx ruff format $CHANGED_FILES | |
| else | |
| echo "No Python files changed, skipping format." | |
| fi |