Closed alichaudry closed 5 months ago
here you go
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract ruff version from requirements.txt
id: ruff_version
run: echo "::set-output name=version::$(grep -oP 'ruff==\K[^"]+' requirements.txt)"
- uses: chartboost/ruff-action@v1
with:
args: --config tests/ruff.toml
version: ${{ steps.ruff_version.outputs.version }}
@brycedrennan -- THANKS! This looks like it works well from a requirements.txt file [ which can also be generated from a pyproject.toml/poetry config ].
Anyone that's sufficiently interested, we'd welcome a way to handle this as part of this action [ anyone want to add that functionality? ].
It also invites interesting questions like what to do if both pyproject.toml and requirements.txt exist ... etc... :-)
marking closed, since looks like addressed
Hello, is there a way to pull the ruff version to be used from a specific requirements.txt (or pyproject.toml) file? Currently I have to hardcode the ruff version in two locations to get this to work, but it would be nice to keep the ruff-action version in sync with what's being used in the Python develop/build manifest.
Or if there are other workflows to solve for this problem that I may not have considered, happy to try those out as well.
Cheers!