fix(ruff)

closes #6530
closes #6531
This commit is contained in:
Jacob Heider 2024-06-27 12:01:35 -04:00 committed by Jacob Heider
parent a8574519fc
commit d95529e9f5
2 changed files with 19 additions and 7 deletions

View file

@ -1,5 +1,5 @@
distributable:
url: https://github.com/astral-sh/ruff/archive/refs/tags/v{{version}}.tar.gz
url: https://github.com/astral-sh/ruff/archive/refs/tags/{{ version.tag }}.tar.gz
strip-components: 1
versions:
@ -30,8 +30,14 @@ test:
# Cause: No such file or directory (os error 2)
- run: mkdir -p .ruff_cache/{{version}}
if: '>=0.1.12'
- run:
- ruff -e $FIXTURE | grep "\`os\` imported but unused"
- ruff --fix $FIXTURE
if: <0.5
- run:
- (ruff check $FIXTURE || true) | grep "\`os\` imported but unused"
- ruff check --fix $FIXTURE
if: '>=0.5'
- test ! -s $FIXTURE
fixture: |
import os

View file

@ -1,5 +1,5 @@
distributable:
url: https://github.com/astral-sh/ruff/archive/refs/tags/v{{version}}.tar.gz
url: https://github.com/astral-sh/ruff/archive/refs/tags/{{ version.tag }}.tar.gz
strip-components: 1
versions:
@ -30,12 +30,18 @@ test:
script:
# v0.1.12 introduced this test error:
# ruff failed
# Cause: Failed to create cache file '/__w/pantry/pantry/testbeds/github.com__charliermarsh__ruff-0.1.12/.ruff_cache/0.1.12/10391082687706843805'
# Cause: Failed to create cache file '/__w/pantry/pantry/testbeds/astral.sh__ruff-0.1.12/.ruff_cache/0.1.12/10391082687706843805'
# Cause: No such file or directory (os error 2)
- run: mkdir -p .ruff_cache/{{version}}
if: '>=0.1.12'
- run:
- ruff -e $FIXTURE | grep "\`os\` imported but unused"
- ruff --fix $FIXTURE
if: <0.5
- run:
- (ruff check $FIXTURE || true) | grep "\`os\` imported but unused"
- ruff check --fix $FIXTURE
if: '>=0.5'
- test ! -s $FIXTURE
fixture: |
import os