pub struct FixCoordinator { /* private fields */ }Expand description
Coordinates rule fixing to minimize the number of passes needed
Implementations§
Source§impl FixCoordinator
impl FixCoordinator
pub fn new() -> Self
Sourcepub fn get_optimal_order<'a>(
&self,
rules: &'a [Box<dyn Rule>],
) -> Vec<&'a dyn Rule>
pub fn get_optimal_order<'a>( &self, rules: &'a [Box<dyn Rule>], ) -> Vec<&'a dyn Rule>
Get the optimal order for running rules based on dependencies
Sourcepub fn apply_fixes_iterative(
&self,
rules: &[Box<dyn Rule>],
all_warnings: &[LintWarning],
content: &mut String,
config: &Config,
max_iterations: usize,
file_path: Option<&Path>,
) -> Result<FixResult, String>
pub fn apply_fixes_iterative( &self, rules: &[Box<dyn Rule>], all_warnings: &[LintWarning], content: &mut String, config: &Config, max_iterations: usize, file_path: Option<&Path>, ) -> Result<FixResult, String>
Apply fixes iteratively until no more fixes are needed or max iterations reached.
This implements a Ruff-inspired fix loop that re-checks ALL rules after each fix to detect cascading issues (e.g., MD046 creating code blocks that MD040 needs to fix).
The file_path parameter is used to determine per-file flavor overrides. If provided,
the flavor for creating LintContext will be resolved using config.get_flavor_for_file().
Sourcepub fn apply_fixes_iterative_with_paths(
&self,
rules: &[Box<dyn Rule>],
_all_warnings: &[LintWarning],
content: &mut String,
config: &Config,
max_iterations: usize,
paths: DocumentPaths<'_>,
) -> Result<FixResult, String>
pub fn apply_fixes_iterative_with_paths( &self, rules: &[Box<dyn Rule>], _all_warnings: &[LintWarning], content: &mut String, config: &Config, max_iterations: usize, paths: DocumentPaths<'_>, ) -> Result<FixResult, String>
Apply fixes with separate paths for configuration matching and rule filesystem access.
Native file adapters pass the same path for both. Virtual adapters can use a
logical config_path for per-file flavor and ignores while leaving
source_file unset so filesystem-dependent rules stay disabled.