Skip to content

Commit

Permalink
Remove remaining ruff_shrinking references (#11272)
Browse files Browse the repository at this point in the history
## Summary

This caused `rooster release` to fail.

Initially removed in #11242.
  • Loading branch information
charliermarsh committed May 3, 2024
1 parent 8dd3811 commit d0f51c6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 92 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
- "!crates/ruff_python_formatter/**"
- "!crates/ruff_formatter/**"
- "!crates/ruff_dev/**"
- "!crates/ruff_shrinking/**"
- scripts/*
- python/**
- .github/workflows/ci.yaml
Expand Down
15 changes: 0 additions & 15 deletions crates/ruff_python_formatter/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,6 @@ python scripts/check_ecosystem.py --checkouts target/checkouts --projects github
cargo run --bin ruff_dev -- format-dev --stability-check --error-file target/formatter-ecosystem-errors.txt --multi-project target/checkouts
```

**Shrinking** To shrink a formatter error from an entire file to a minimal reproducible example,
you can use `ruff_shrinking`:

```shell
cargo run --bin ruff_shrinking -- <your_file> target/shrinking.py "Unstable formatting" "target/debug/ruff_dev format-dev --stability-check target/shrinking.py"
```

The first argument is the input file, the second is the output file where the candidates
and the eventual minimized version will be written to. The third argument is a regex matching the
error message, e.g. "Unstable formatting" or "Formatter error". The last argument is the command
with the error, e.g. running the stability check on the candidate file. The script will try various
strategies to remove parts of the code. If the output of the command still matches, it will use that
slightly smaller code as starting point for the next iteration, otherwise it will revert and try
a different strategy until all strategies are exhausted.

## Helper structs

To abstract formatting something into a helper, create a new struct with the data you want to
Expand Down
75 changes: 0 additions & 75 deletions crates/ruff_python_formatter/shrink_formatter_errors.py

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,5 @@ version_files = [
"docs/integrations.md",
"crates/ruff/Cargo.toml",
"crates/ruff_linter/Cargo.toml",
"crates/ruff_shrinking/Cargo.toml",
"scripts/benchmarks/pyproject.toml",
]

0 comments on commit d0f51c6

Please sign in to comment.