Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefer splitting right hand side of assignments
- Loading branch information
1 parent
1de4fcd
commit e6977a2
Showing
22 changed files
with
612 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
///! Helpers to test if a specific preview style is enabled or not. | ||
/// | ||
/// The motivation for these functions isn't to avoid code duplication but to ease promoting preview styles | ||
/// to stable. The challenge with directly using [`is_preview`](PyFormatContext::is_preview) is that it is unclear | ||
/// for which specific feature this preview check is for. Having named functions simplifies the promotion: | ||
/// Simply delete the function and let Rust tell you which checks you have to remove. | ||
use crate::PyFormatContext; | ||
|
||
/// Returns `true` if the [`prefer_splitting_right_hand_side_of_assignments`](https://github.com/astral-sh/ruff/issues/6975) layout is enabled. | ||
pub(crate) const fn is_prefer_splitting_right_hand_side_of_assignments_enabled( | ||
context: &PyFormatContext, | ||
) -> bool { | ||
context.is_preview() | ||
} |
Oops, something went wrong.