2023-01-31 01:59:17 +03:00
|
|
|
distributable:
|
2023-12-24 03:02:45 +03:00
|
|
|
url: https://github.com/astral-sh/ruff/archive/refs/tags/v{{version}}.tar.gz
|
2023-01-31 01:59:17 +03:00
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
2023-12-24 03:02:45 +03:00
|
|
|
github: astral-sh/ruff
|
2023-01-31 01:59:17 +03:00
|
|
|
strip: /^v /
|
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
rust-lang.org: '>=1.60'
|
|
|
|
rust-lang.org/cargo: '*'
|
2023-02-07 00:54:26 +03:00
|
|
|
crates.io/semverator: '*'
|
|
|
|
script: |
|
|
|
|
if semverator lt {{version}} 0.0.242; then
|
|
|
|
CRATE=ruff_cli
|
2024-01-19 23:38:40 +03:00
|
|
|
elif semverator lt {{version}} 0.1.14; then
|
2023-02-07 00:54:26 +03:00
|
|
|
CRATE=crates/ruff_cli
|
2024-01-19 23:38:40 +03:00
|
|
|
else
|
|
|
|
CRATE=crates/ruff
|
2023-02-07 00:54:26 +03:00
|
|
|
fi
|
|
|
|
cargo install --locked --path $CRATE --root {{prefix}}
|
2023-01-31 01:59:17 +03:00
|
|
|
|
2023-12-24 03:02:45 +03:00
|
|
|
renamed-to: astral.sh/ruff
|
|
|
|
|
|
|
|
# provides:
|
|
|
|
# - bin/ruff
|
2023-01-31 01:59:17 +03:00
|
|
|
|
|
|
|
test:
|
2024-01-12 06:46:46 +03:00
|
|
|
script:
|
2024-01-12 18:33:24 +03:00
|
|
|
# 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: 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'
|
|
|
|
- ruff -e $FIXTURE | grep "\`os\` imported but unused"
|
|
|
|
- ruff --fix $FIXTURE
|
|
|
|
- test ! -s $FIXTURE
|
2023-01-31 01:59:17 +03:00
|
|
|
fixture: |
|
|
|
|
import os
|