From 0e6574d1ba3bbb6865f9745e621f913920b3a8ed Mon Sep 17 00:00:00 2001 From: Andreas Olsson Date: Sun, 12 May 2024 15:11:18 +0200 Subject: [PATCH] Add ruff --target-version to linter workflow --- .github/workflows/linter.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 904da2f..8b9330a 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -34,11 +34,19 @@ jobs: .venv/bin/pip install --upgrade pip setuptools .venv/bin/pip install ruff mypy types-requests + - name: Detect Python version + id: detect + run: echo "pyver=$(python3 -c 'import sys; print(f"py{sys.version_info.major}{sys.version_info.minor}")')" >> "$GITHUB_OUTPUT" + - name: Check ruff formating - run: .venv/bin/ruff format --diff vault_oidc_ssh_cert_action.py + run: .venv/bin/ruff format --target-version "$PYVER" --diff vault_oidc_ssh_cert_action.py + env: + PYVER: ${{ steps.detect.outputs.pyver }} - name: Check ruff linting - run: .venv/bin/ruff check vault_oidc_ssh_cert_action.py + run: .venv/bin/ruff check --target-version "$PYVER" vault_oidc_ssh_cert_action.py + env: + PYVER: ${{ steps.detect.outputs.pyver }} - name: Check type hints run: .venv/bin/mypy --strict vault_oidc_ssh_cert_action.py