mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Expose a public 'check' method (#289)
This commit is contained in:
parent
1e36c109c6
commit
417764d309
3 changed files with 60 additions and 3 deletions
|
@ -16,7 +16,7 @@ use crate::settings::Settings;
|
|||
use crate::{cache, fs, noqa};
|
||||
|
||||
/// Collect tokens up to and including the first error.
|
||||
fn tokenize(contents: &str) -> Vec<LexResult> {
|
||||
pub(crate) fn tokenize(contents: &str) -> Vec<LexResult> {
|
||||
let mut tokens: Vec<LexResult> = vec![];
|
||||
for tok in lexer::make_tokenizer(contents) {
|
||||
let is_err = tok.is_err();
|
||||
|
@ -28,7 +28,7 @@ fn tokenize(contents: &str) -> Vec<LexResult> {
|
|||
tokens
|
||||
}
|
||||
|
||||
fn check_path(
|
||||
pub(crate) fn check_path(
|
||||
path: &Path,
|
||||
contents: &str,
|
||||
tokens: Vec<LexResult>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue