MCPcopy Create free account
hub / github.com/astral-sh/ruff / push

Method push

crates/ruff_python_formatter/src/string/docstring.rs:1235–1242  ·  view source on GitHub ↗

Pushes the given line as part of this code example.

(&mut self, original: InputDocstringLine<'src>)

Source from the content-addressed store, hash-verified

1233
1234 /// Pushes the given line as part of this code example.
1235 fn push(&mut self, original: InputDocstringLine<'src>) {
1236 // N.B. We record the code portion as identical to the original line.
1237 // When we go to reformat the code lines, we change them by removing
1238 // the `min_indent`. This design is necessary because the true value of
1239 // `min_indent` isn't known until the entire block has been parsed.
1240 let code = original.line;
1241 self.lines.push(CodeExampleLine { original, code });
1242 }
1243
1244 /// Consume this block and add actions to the give queue for formatting.
1245 ///

Callers 15

testMethod · 0.45
testMethod · 0.45
normalize_integerFunction · 0.45
recurse_compareMethod · 0.45
recurse_boolMethod · 0.45
recurse_binaryMethod · 0.45
recMethod · 0.45
add_code_lineMethod · 0.45
add_first_lineMethod · 0.45
normalize_stringFunction · 0.45
normalizeMethod · 0.45

Calls 1

trim_start_strMethod · 0.80

Tested by 3

push_literalMethod · 0.36
push_expressionMethod · 0.36
visit_stmtMethod · 0.36