ruff/crates
Charlie Marsh bd46cd1fcf
Infer indentation with imports when logical indent is absent (#11608)
## Summary

In an `__init__.py` file, it's not uncommon to lack a logical indent
(since it may just contain imports). In such cases, we were always
falling back to four-space indent. This PR adds detection for indents
within import groups.

Closes https://github.com/astral-sh/ruff/issues/11606.
2024-05-30 00:18:07 -04:00
..
red_knot [redknot] add module type and attribute lookup for some types (#11416) 2024-05-28 13:13:03 -07:00
ruff docs: Minor formatting typo in F401 example. (#11601) 2024-05-29 11:14:53 -04:00
ruff_benchmark use owned ast and tokens in bench (#11598) 2024-05-29 18:10:32 +02:00
ruff_cache Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_dev Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_diagnostics Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_formatter Remove some unused `pub` functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_index Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_linter Infer indentation with imports when logical indent is absent (#11608) 2024-05-30 00:18:07 -04:00
ruff_macros Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_notebook `ruff server`: Support Jupyter Notebook (`*.ipynb`) files (#11206) 2024-05-21 22:29:30 +00:00
ruff_python_ast [`flake8-pyi`] Implement `PYI064` (#11325) 2024-05-28 23:57:13 +00:00
ruff_python_ast_integration_tests Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_python_codegen Infer indentation with imports when logical indent is absent (#11608) 2024-05-30 00:18:07 -04:00
ruff_python_formatter Implement a common trait for the string flags (#11564) 2024-05-27 16:02:01 +01:00
ruff_python_index Implement a common trait for the string flags (#11564) 2024-05-27 16:02:01 +01:00
ruff_python_literal Remove some unused `pub` functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Remove some unused `pub` functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Propagate reads on global variables (#11584) 2024-05-28 14:47:05 -04:00
ruff_python_stdlib Regenerate sys.rs with stdlibs==2024.5.15 (#11437) 2024-05-15 22:17:32 +00:00
ruff_python_trivia Move `has_comments` to `CommentRanges` (#11495) 2024-05-22 13:35:16 +00:00
ruff_python_trivia_integration_tests Add `Tokens` newtype wrapper, `TokenKind` iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_server use owned ast and tokens in bench (#11598) 2024-05-29 18:10:32 +02:00
ruff_source_file Move sub-crates to workspace dependencies (#11407) 2024-05-13 14:37:50 +00:00
ruff_text_size Range formatting: Fix invalid syntax after parenthesizing expression (#9751) 2024-02-02 17:56:25 +01:00
ruff_wasm Add `Tokens` newtype wrapper, `TokenKind` iterator (#11361) 2024-05-14 16:45:04 +00:00
ruff_workspace Respect file exclusions in `ruff server` (#11590) 2024-05-29 02:58:36 +00:00