ruff/crates/ruff_python_formatter/src
Charlie Marsh 1c02fcd7ce
Avoid unnecessary comments check in maybe_parenthesize_expression (#7686)
## Summary

No-op refactor, but we can evaluate early if the first part of
`preserve_parentheses || has_comments` is `true`, and thus avoid looking
up the node comments.

## Test Plan

`cargo test`
2023-09-28 13:42:12 -04:00
..
comments Improve some comments in normalize_comment (#7688) 2023-09-28 03:08:25 +00:00
expression Avoid unnecessary comments check in maybe_parenthesize_expression (#7686) 2023-09-28 13:42:12 -04:00
module Fix handling of newlines in empty files (#7473) 2023-09-18 06:08:10 +00:00
other Prefer preserving WithItem parentheses (#7694) 2023-09-28 14:42:40 +01:00
pattern Avoid expanding single-element tuple patterns (#7683) 2023-09-27 23:57:18 +00:00
snapshots Remove exception-handler lexing from unused-bound-exception fix (#5851) 2023-07-18 18:27:46 +00:00
statement Break with on end-of-line trailing comments (#7685) 2023-09-28 00:16:40 +00:00
type_param Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
builders.rs Introduce Token element (#7048) 2023-09-02 10:05:47 +02:00
cli.rs Formatter and parser refactoring (#7569) 2023-09-26 15:29:43 +02:00
context.rs Implement DerefMut for WithNodeLevel (#6443) 2023-08-11 10:41:48 +00:00
generated.rs Introduce AST nodes for PatternMatchClass arguments (#6881) 2023-08-26 14:45:44 +00:00
lib.rs Formatter and parser refactoring (#7569) 2023-09-26 15:29:43 +02:00
main.rs Formatter and parser refactoring (#7569) 2023-09-26 15:29:43 +02:00
options.rs Add most formatter options to ruff.toml / pyproject.toml (#7566) 2023-09-22 15:47:57 +00:00
prelude.rs Accept any Into<AnyNodeRef> as Comments arguments (#5205) 2023-06-20 16:49:21 +00:00
verbatim.rs Memoize text width (#6552) 2023-09-06 07:10:13 +00:00