Skip to content

Commit

Permalink
use astral lint action
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Nov 25, 2024
1 parent 20a3827 commit 5a9266a
Showing 1 changed file with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions .github/workflows/check-sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,49 +45,15 @@ jobs:
with:
python-version: "3.11"
cache: "pip"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: 🛠️ Install development tools and dependencies
run: |
pip install -e .[dev]
- name: 🪮 Check source code formatting
id: format
run: |
if ruff format --diff $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code not formatted"
fi
env:
PKG_DIR: xshaper
run: uv sync --dev
- name: 🐜 Check source code lint rules
uses: astral-sh/ruff-action@v1
id: lint
run: |
if ruff check --output-format=github $PKG_DIR; then
echo passed=yes >>"$GITHUB_OUTPUT"
else
echo passed=no >>"$GITHUB_OUTPUT"
echo "::error::source code lint check failed"
fi
env:
PKG_DIR: xshaper
- name: 🧾 Checking lint and format results
run: |
if [ "$FMT_PASSED" = no ]; then
echo "::error::format failed, failing build"
exit 1
fi
if [ "$LINT_PASSED" = no ]; then
if [ "$LINT_REQUIRED" = true ]; then
echo "::error::lint failed, failing build"
exit 2
else
echo "::error::lint failed but non-mandatory"
fi
fi
env:
FMT_PASSED: ${{ steps.format.outputs.passed }}
LINT_PASSED: ${{ steps.lint.outputs.passed }}
LINT_REQUIRED: True
with:
args: check --output-format=github xshaper
- name: 📐 Check types
id: typecheck
uses: jakebailey/pyright-action@v1
Expand Down

0 comments on commit 5a9266a

Please sign in to comment.