From 4586c7dcb365483e0c9bfea667822eadd04735ad Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 9 Mar 2026 13:49:13 -0500 Subject: [PATCH] Add shared python-lint composite action using uvx ruff Co-Authored-By: Claude Opus 4.6 --- python-lint/action.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 python-lint/action.yml diff --git a/python-lint/action.yml b/python-lint/action.yml new file mode 100644 index 0000000..6e775d7 --- /dev/null +++ b/python-lint/action.yml @@ -0,0 +1,38 @@ +# Python Lint +# Runs ruff check via uvx (no pip install needed) +# Bootstraps uv if not already available on the runner + +name: Python Lint +description: Run ruff check on Python source code using uvx + +inputs: + src: + description: Source directory or file to check + default: '.' + ruff-version: + description: Ruff version to use (e.g., 0.9.x) + default: '' + extra-args: + description: Additional arguments to pass to ruff check + default: '' + +runs: + using: composite + steps: + - name: Ensure uv is available + shell: bash + run: | + if ! command -v uv &>/dev/null; then + echo "uv not found, installing..." + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.local/bin" >> $GITHUB_PATH + fi + + - name: Run ruff check + shell: bash + run: | + RUFF_SPEC="ruff" + if [ -n "${{ inputs.ruff-version }}" ]; then + RUFF_SPEC="ruff@${{ inputs.ruff-version }}" + fi + uvx $RUFF_SPEC check ${{ inputs.extra-args }} ${{ inputs.src }}