-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d4f8e5
commit f7e1cf4
Showing
27 changed files
with
914 additions
and
541 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
36 changes: 36 additions & 0 deletions
36
crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/class_definition.py
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,36 @@ | ||
class Test( | ||
Aaaaaaaaaaaaaaaaa, | ||
Bbbbbbbbbbbbbbbb, | ||
DDDDDDDDDDDDDDDD, | ||
EEEEEEEEEEEEEE, | ||
metaclass=meta, | ||
): | ||
pass | ||
|
||
|
||
class Test((Aaaaaaaaaaaaaaaaa), Bbbbbbbbbbbbbbbb, metaclass=meta): | ||
pass | ||
|
||
class Test( # trailing class comment | ||
Aaaaaaaaaaaaaaaaa, # trailing comment | ||
|
||
# in between comment | ||
|
||
Bbbbbbbbbbbbbbbb, | ||
# another leading comment | ||
DDDDDDDDDDDDDDDD, | ||
EEEEEEEEEEEEEE, | ||
# meta comment | ||
metaclass=meta, # trailing meta comment | ||
): | ||
pass | ||
|
||
class Test((Aaaa)): | ||
... | ||
|
||
|
||
class Test(aaaaaaaaaaaaaaa + bbbbbbbbbbbbbbbbbbbbbb + cccccccccccccccccccccccc + dddddddddddddddddddddd + eeeeeeeee, ffffffffffffffffff, gggggggggggggggggg): | ||
pass | ||
|
||
class Test(Aaaa): # trailing comment | ||
pass |
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
use crate::{not_yet_implemented, FormatNodeRule, PyFormatter}; | ||
use ruff_formatter::{write, Buffer, FormatResult}; | ||
use crate::prelude::*; | ||
use crate::FormatNodeRule; | ||
use ruff_formatter::write; | ||
use rustpython_parser::ast::Keyword; | ||
|
||
#[derive(Default)] | ||
pub struct FormatKeyword; | ||
|
||
impl FormatNodeRule<Keyword> for FormatKeyword { | ||
fn fmt_fields(&self, item: &Keyword, f: &mut PyFormatter) -> FormatResult<()> { | ||
write!(f, [not_yet_implemented(item)]) | ||
let Keyword { | ||
range: _, | ||
arg, | ||
value, | ||
} = item; | ||
if let Some(argument) = arg { | ||
write!(f, [argument.format(), text("=")])?; | ||
} | ||
|
||
value.format().fmt(f) | ||
} | ||
} |
135 changes: 0 additions & 135 deletions
135
...r/src/snapshots/ruff_python_formatter__tests__black_test__class_blank_parentheses_py.snap
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.