refactor: Document internal test_path function

This commit is contained in:
Martin Fischer 2023-02-01 06:47:22 +01:00 committed by Charlie Marsh
parent 56ad160c05
commit cfd0693ae5
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ use crate::{
source_code::{Indexer, Locator, Stylist}, source_code::{Indexer, Locator, Stylist},
}; };
/// A convenient wrapper around [`check_path`], that additionally
/// asserts that autofixes converge after 10 iterations.
pub fn test_path(path: &Path, settings: &Settings) -> Result<Vec<Diagnostic>> { pub fn test_path(path: &Path, settings: &Settings) -> Result<Vec<Diagnostic>> {
let contents = fs::read_file(path)?; let contents = fs::read_file(path)?;
let tokens: Vec<LexResult> = rustpython_helpers::tokenize(&contents); let tokens: Vec<LexResult> = rustpython_helpers::tokenize(&contents);