pantry/projects/astral.sh/ruff/package.yml

38 lines
973 B
YAML
Raw Normal View History

2023-12-24 03:02:45 +03:00
distributable:
url: https://github.com/astral-sh/ruff/archive/refs/tags/v{{version}}.tar.gz
strip-components: 1
versions:
github: charliermarsh/ruff
strip: /^v /
build:
dependencies:
rust-lang.org: '>=1.60'
rust-lang.org/cargo: '*'
script:
- run: CRATE=ruff_cli
if: <0.0.242
- run: CRATE=crates/ruff_cli
2024-01-19 23:38:40 +03:00
if: '>=0.0.242<0.1.14'
- run: CRATE=crates/ruff
if: '>=0.1.14'
2023-12-24 03:02:45 +03:00
- cargo install --locked --path $CRATE --root {{prefix}}
provides:
- bin/ruff
test:
script:
# v0.1.12 introduced this test error:
# ruff failed
# 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)
2024-01-12 06:46:46 +03:00
- run: mkdir -p .ruff_cache/{{version}}
if: '>=0.1.12'
2023-12-24 03:02:45 +03:00
- ruff -e $FIXTURE | grep "\`os\` imported but unused"
- ruff --fix $FIXTURE
- test ! -s $FIXTURE
fixture: |
import os