ruff/scripts
konstin 0096938789
Optionally show fixes when using --features ecosystem_ci with cargo and --show-fixes at runtime (#4191)
* Generate fixes when using --show-fixes

Example command: `cargo run --bin ruff -- --no-cache --select F401
--show-source --show-fixes
crates/ruff/resources/test/fixtures/pyflakes/F401_9.py`

Before, `--show-fixes` was ignored:

```
crates/ruff/resources/test/fixtures/pyflakes/F401_9.py:4:22: F401 [*] `foo.baz` imported but unused
  |
4 | __all__ = ("bar",)
5 | from foo import bar, baz
  |                      ^^^ F401
  |
  = help: Remove unused import: `foo.baz`

Found 1 error.
[*] 1 potentially fixable with the --fix option.
```

After:

```
crates/ruff/resources/test/fixtures/pyflakes/F401_9.py:4:22: F401 [*] `foo.baz` imported but unused
  |
4 | __all__ = ("bar",)
5 | from foo import bar, baz
  |                      ^^^ F401
  |
  = help: Remove unused import: `foo.baz`

ℹ Suggested fix
1 1 | """Test: late-binding of `__all__`."""
2 2 |
3 3 | __all__ = ("bar",)
4   |-from foo import bar, baz
  4 |+from foo import bar

Found 1 error.
[*] 1 potentially fixable with the --fix option.
```

* Add `--format ecosystem-ci`

* cargo dev generate-all

* Put behind cargo feature

* Regenerate docs

* Don't test ecosystem_ci feature on CI

* Use top level flag instead

* Fix

* Simplify code based on #4191

* Remove old TODO comment
2023-05-10 17:45:57 +02:00
..
benchmarks Use --filter=blob:none to clone CPython faster (#4156) 2023-04-30 13:39:22 +02:00
_utils.py Improve add_rule.py and add_plugin.py scripts (#3725) 2023-03-25 16:05:39 +00:00
add_plugin.py Pretty print Diagnostics in snapshot tests (#3906) 2023-04-11 09:03:00 +00:00
add_rule.py Replace row/column based Location with byte-offsets. (#3931) 2023-04-26 18:11:02 +00:00
check_docs_formatted.py Check that all rules have descriptions (#4315) 2023-05-09 16:53:23 +00:00
check_ecosystem.py Extended ecosystem check with scraped data (#3858) 2023-04-06 22:39:48 +00:00
Dockerfile.ecosystem Optionally show fixes when using --features ecosystem_ci with cargo and --show-fixes at runtime (#4191) 2023-05-10 17:45:57 +02:00
generate_known_standard_library.py fix(docs): broken links inside Configuration.md (#3205) 2023-02-24 18:55:33 +00:00
generate_mkdocs.py Doc/CLN: pass pre-commit (#3604) 2023-03-19 19:20:11 +00:00
pyproject.toml Check docs formatting check (#4270) 2023-05-08 19:03:22 +00:00
transform_readme.py Fix hardcoded url in transform_readme.py (#2487) 2023-02-02 13:59:22 -05:00
update_ambiguous_characters.py Update confusable character mapping (#4274) 2023-05-08 14:20:44 -04:00