mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Formatter: Add SourceType to context to enable special formatting for stub files (#6331)
**Summary** This adds the information whether we're in a .py python source file or in a .pyi stub file to enable people working on #5822 and related issues. I'm not completely happy with `Default` for something that depends on the input. **Test Plan** None, this is currently unused, i'm leaving this to first implementation of stub file specific formatting. --------- Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
fe97a2a302
commit
1031bb6550
12 changed files with 137 additions and 97 deletions
|
@ -32,7 +32,7 @@ smallvec = { workspace = true }
|
|||
thiserror = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
ruff_formatter = { path = "../ruff_formatter", features = ["serde"]}
|
||||
ruff_formatter = { path = "../ruff_formatter", features = ["serde"] }
|
||||
|
||||
insta = { workspace = true, features = ["glob"] }
|
||||
serde = { workspace = true }
|
||||
|
@ -43,8 +43,8 @@ similar = { workspace = true }
|
|||
name = "ruff_python_formatter_fixtures"
|
||||
path = "tests/fixtures.rs"
|
||||
test = true
|
||||
required-features = [ "serde" ]
|
||||
required-features = ["serde"]
|
||||
|
||||
[features]
|
||||
serde = ["dep:serde", "ruff_formatter/serde", "ruff_source_file/serde"]
|
||||
serde = ["dep:serde", "ruff_formatter/serde", "ruff_source_file/serde", "ruff_python_ast/serde"]
|
||||
default = ["serde"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue