ruff/crates
Shahar Naveh cb1ba0d4c2
Expose Indentation in ruff_python_codegen (#20216)
## Summary

I'm trying to reduce code complexity for
[RustPython](https://github.com/RustPython/RustPython), we have this
file:
056795eed4/compiler/codegen/src/unparse.rs
which can be replaced entirely by `ruff_python_codegen::Generator`.
Unfortunately we can not create an instance of `Generator` easily,
because `Indentation` is not exported at
cda376afe0/crates/ruff_python_codegen/src/lib.rs (L3)

I have managed to bypass this restriction by doing:
```rust
let contents = r"x = 1";
let module = ruff_python_parser::parse_module(contents).unwrap();
let stylist = ruff_python_codegen::Stylist::from_tokens(module.tokens(), contents);
stylist.indentation()
```

But ideally I'd rather use:
```rust
ruff_python_codegen::Indentation::default()
```
2025-09-03 13:32:31 -04:00
..
ruff Show fixes by default (#19919) 2025-08-29 09:53:05 -04:00
ruff_annotate_snippets Move full diagnostic rendering to ruff_db (#19415) 2025-08-08 12:56:23 -04:00
ruff_benchmark [ty] Benchmarks for problematic implicit instance attributes cases (#20133) 2025-08-28 15:25:25 +02:00
ruff_cache
ruff_db [ty] Add GitLab output format (#20155) 2025-09-03 09:08:12 -04:00
ruff_dev [ty] Remove duplicate global lint registry (#20053) 2025-08-22 19:43:12 -04:00
ruff_diagnostics Fix rust feature activation (#20012) 2025-08-21 09:26:06 +02:00
ruff_formatter
ruff_graph
ruff_index
ruff_linter [airflow] Move airflow.operators.postgres_operator.Mapping from AIR302 to AIR301 (#20172) 2025-09-03 10:18:17 -04:00
ruff_macros Don't cache files with diagnostics (#19869) 2025-08-12 15:28:44 -04:00
ruff_memory_usage [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00
ruff_notebook Improve diff rendering for notebooks (#20036) 2025-08-25 09:20:42 -04:00
ruff_options_metadata
ruff_python_ast Less confidently mark f-strings as empty when inferring truthiness (#20152) 2025-08-29 22:12:54 +00:00
ruff_python_ast_integration_tests
ruff_python_codegen Expose Indentation in ruff_python_codegen (#20216) 2025-09-03 13:32:31 -04:00
ruff_python_formatter [ty] Shrink size of AstNodeRef (#20028) 2025-08-22 17:03:22 -04:00
ruff_python_index
ruff_python_literal
ruff_python_parser [syntax-errors] Detect yield from inside async function (#20051) 2025-09-03 10:13:05 -04:00
ruff_python_semantic Add a ScopeKind for the __class__ cell (#20048) 2025-08-26 09:49:08 -04:00
ruff_python_stdlib
ruff_python_trivia [ruff] Preserve relative whitespace in multi-line expressions (RUF033) (#19647) 2025-08-27 19:15:44 +00:00
ruff_python_trivia_integration_tests
ruff_server
ruff_source_file Move diff rendering to ruff_db (#20006) 2025-08-21 09:47:00 -04:00
ruff_text_size [ty] Fix a few more diagnostic differences from Ruff (#19806) 2025-08-08 11:31:19 -04:00
ruff_wasm Bump 0.12.11 (#20136) 2025-08-28 09:45:01 -04:00
ruff_workspace Fix rust feature activation (#20012) 2025-08-21 09:26:06 +02:00
ty [ty] Make Module::all_submodules return Module instead of Name 2025-09-03 09:57:26 -04:00
ty_combine [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
ty_ide [ty] Pick up typed text as a query for unimported completions 2025-09-03 09:57:26 -04:00
ty_project [ty] Add GitLab output format (#20155) 2025-09-03 09:08:12 -04:00
ty_python_semantic [ty]eliminate definitely-impossible types from union in equality narrowing (#20164) 2025-09-03 08:34:22 -07:00
ty_server [ty] Correct default value for experimental rename setting 2025-09-03 09:57:26 -04:00
ty_static [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
ty_test Fix mdtest ignore python code blocks (#20139) 2025-08-28 09:59:03 -07:00
ty_vendored [ty] Sync vendored typeshed stubs (#20188) 2025-09-01 06:27:48 +01:00
ty_wasm [ty] Make auto-import completions opt-in via an experimental option 2025-09-03 09:57:26 -04:00