Move Python whitespace utilities into new ruff_python_whitespace crate (#4993)

## Summary

`ruff_newlines` becomes `ruff_python_whitespace`, and includes the
existing "universal newline" handlers alongside the Python
whitespace-specific utilities.
This commit is contained in:
Charlie Marsh 2023-06-09 20:59:57 -04:00 committed by GitHub
parent e86f12a1ec
commit 1d756dc3a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 153 additions and 140 deletions

View file

@ -8,7 +8,7 @@ use rustpython_parser::ast::{
Excepthandler, Expr, Identifier, MatchCase, Operator, Pattern, Stmt, Suite, Withitem,
};
use ruff_newlines::LineEnding;
use ruff_python_whitespace::LineEnding;
use crate::source_code::stylist::{Indentation, Quote, Stylist};
@ -1459,7 +1459,7 @@ mod tests {
use rustpython_ast::Suite;
use rustpython_parser::Parse;
use ruff_newlines::LineEnding;
use ruff_python_whitespace::LineEnding;
use crate::source_code::stylist::{Indentation, Quote};
use crate::source_code::Generator;

View file

@ -6,7 +6,7 @@ use memchr::{memchr2, memrchr2};
use once_cell::unsync::OnceCell;
use ruff_text_size::{TextLen, TextRange, TextSize};
use ruff_newlines::find_newline;
use ruff_python_whitespace::find_newline;
use crate::source_code::{LineIndex, OneIndexed, SourceCode, SourceLocation};

View file

@ -4,7 +4,7 @@ use std::fmt;
use std::ops::Deref;
use once_cell::unsync::OnceCell;
use ruff_newlines::{find_newline, LineEnding};
use ruff_python_whitespace::{find_newline, LineEnding};
use rustpython_literal::escape::Quote as StrQuote;
use rustpython_parser::lexer::LexResult;
use rustpython_parser::Tok;
@ -166,7 +166,7 @@ mod tests {
use rustpython_parser::lexer::lex;
use rustpython_parser::Mode;
use ruff_newlines::{find_newline, LineEnding};
use ruff_python_whitespace::{find_newline, LineEnding};
use crate::source_code::stylist::{Indentation, Quote};
use crate::source_code::{Locator, Stylist};