ruff/crates/ruff_python_formatter/src
konsti 1031bb6550
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>
2023-08-04 11:52:26 +00:00
..
comments Fix panic with empty attribute inner comment (#6332) 2023-08-04 11:59:55 +02:00
expression Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
module Add empty lines before nested functions and classes (#6206) 2023-08-01 15:30:59 +00:00
other Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
pattern Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
snapshots Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
statement Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
type_param Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
builders.rs Add formatter support for call and class definition Arguments (#6274) 2023-08-02 11:54:22 -04:00
cli.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
context.rs formatter: WithNodeLevel helper (#6212) 2023-07-31 21:22:17 +00:00
generated.rs Replace Formatter<PyFormatContext<'_>> with PyFormatter (#6330) 2023-08-04 10:48:58 +02:00
lib.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
main.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
options.rs Formatter: Add SourceType to context to enable special formatting for stub files (#6331) 2023-08-04 11:52:26 +00:00
prelude.rs Accept any Into<AnyNodeRef> as Comments arguments (#5205) 2023-06-20 16:49:21 +00:00