pub struct FixOptions {
pub unsafe_fixes: bool,
pub promoted: Vec<String>,
pub disabled: Vec<String>,
pub only: Vec<String>,
pub dry_run: bool,
}Expand description
What a run of fix_file is allowed to do: which fixes count as applicable, which
rules are in scope, and whether anything is written.
The default is the conservative one — safe fixes of every rule, written — so a caller
that sets nothing gets what htl fix with no flags does.
Fields§
§unsafe_fixes: boolApply unsafe fixes too.
promoted: Vec<String>Rules promoted to safe by [fix] unsafe in htl.toml.
disabled: Vec<String>Rules whose fixes are never applied ([fix] disable).
only: Vec<String>Only these rules (--rule a,b); empty = all.
dry_run: boolCompute everything, write nothing.
Implementations§
Source§impl FixOptions
impl FixOptions
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Refuse a rule name none of these filters could ever match.
The filters are string comparisons against the name a candidate was filed under
(the rule a diagnostic is filed under), so a name that is not a rule quietly matches nothing: --rule nil-idex would report a run that fixed nothing, which is what a project with
nothing to fix also reports. The names come from a person either way — a flag or
[fix] in htl.toml — so they are held to the registry the way a lint spec is
(crate::lint::check_fix_rules).
Trait Implementations§
Source§impl Clone for FixOptions
impl Clone for FixOptions
Source§fn clone(&self) -> FixOptions
fn clone(&self) -> FixOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FixOptions
impl Debug for FixOptions
Source§impl Default for FixOptions
impl Default for FixOptions
Source§fn default() -> FixOptions
fn default() -> FixOptions
Auto Trait Implementations§
impl Freeze for FixOptions
impl RefUnwindSafe for FixOptions
impl Send for FixOptions
impl Sync for FixOptions
impl Unpin for FixOptions
impl UnsafeUnpin for FixOptions
impl UnwindSafe for FixOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more