Use indentation consistently (#12293)

This commit is contained in:
Victorien 2024-07-12 14:08:56 +02:00 committed by GitHub
parent 90e9aae3f4
commit b6545ce5d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 56 additions and 54 deletions

View file

@ -36,7 +36,7 @@ impl<'a> Stylist<'a> {
}
pub fn from_tokens(tokens: &Tokens, locator: &'a Locator<'a>) -> Self {
let indentation = detect_indention(tokens, locator);
let indentation = detect_indentation(tokens, locator);
Self {
locator,
@ -60,7 +60,7 @@ fn detect_quote(tokens: &[Token]) -> Quote {
Quote::default()
}
fn detect_indention(tokens: &[Token], locator: &Locator) -> Indentation {
fn detect_indentation(tokens: &[Token], locator: &Locator) -> Indentation {
let indent_range = tokens.iter().find_map(|token| {
if matches!(token.kind(), TokenKind::Indent) {
Some(token.range())
@ -204,7 +204,7 @@ x = (
let stylist = Stylist::from_tokens(parsed.tokens(), &locator);
assert_eq!(stylist.indentation(), &Indentation(" ".to_string()));
// formfeed indent, see `detect_indention` comment.
// formfeed indent, see `detect_indentation` comment.
let contents = r"
class FormFeedIndent:
def __init__(self, a=[]):