mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 03:14:41 +00:00
Use named preview test functions (#9239)
This commit is contained in:
parent
d835b28d01
commit
3cc719bd74
3 changed files with 16 additions and 3 deletions
|
@ -11,6 +11,7 @@ use crate::comments::{
|
|||
leading_alternate_branch_comments, trailing_comments, SourceComment, SuppressionKind,
|
||||
};
|
||||
use crate::prelude::*;
|
||||
use crate::preview::is_dummy_implementations_enabled;
|
||||
use crate::statement::suite::{contains_only_an_ellipsis, SuiteKind};
|
||||
use crate::verbatim::write_suppressed_clause_header;
|
||||
|
||||
|
@ -393,7 +394,7 @@ impl Format<PyFormatContext<'_>> for FormatClauseBody<'_> {
|
|||
fn fmt(&self, f: &mut Formatter<PyFormatContext<'_>>) -> FormatResult<()> {
|
||||
// In stable, stubs are only collapsed in stub files, in preview this is consistently
|
||||
// applied everywhere
|
||||
if (f.options().source_type().is_stub() || f.options().preview().is_enabled())
|
||||
if (f.options().source_type().is_stub() || is_dummy_implementations_enabled(f.context()))
|
||||
&& contains_only_an_ellipsis(self.body, f.context().comments())
|
||||
&& self.trailing_comments.is_empty()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue