pub struct AntiPatternDetector { /* private fields */ }Expand description
Scans Perl source for heredoc-related anti-patterns and produces Diagnostics.
Construct with AntiPatternDetector::new, then call detect_all with the
source text. The detector runs all seven built-in pattern checkers and returns
the results sorted by byte offset so callers receive problems in source order.
Implementations§
Source§impl AntiPatternDetector
impl AntiPatternDetector
Sourcepub fn detect_all(&self, code: &str) -> Vec<Diagnostic>
pub fn detect_all(&self, code: &str) -> Vec<Diagnostic>
Run all pattern checkers against code and return diagnostics sorted by offset.
Sourcepub fn format_report(&self, diagnostics: &[Diagnostic]) -> String
pub fn format_report(&self, diagnostics: &[Diagnostic]) -> String
Format a list of diagnostics as a human-readable plain-text report.
Prints a header, a count, and one entry per diagnostic including its severity, location, explanation, optional suggested fix, and references.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AntiPatternDetector
impl !RefUnwindSafe for AntiPatternDetector
impl Send for AntiPatternDetector
impl Sync for AntiPatternDetector
impl Unpin for AntiPatternDetector
impl UnsafeUnpin for AntiPatternDetector
impl !UnwindSafe for AntiPatternDetector
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
Mutably borrows from an owned value. Read more