pub struct SourceFixer;Expand description
Source fixer for various cpplint issues (C/C++/Objective-C)
Implementations§
Source§impl SourceFixer
impl SourceFixer
Sourcepub fn fix_comment_spacing(path: &Path) -> Result<()>
pub fn fix_comment_spacing(path: &Path) -> Result<()>
Fix comment spacing: “//comment” -> “// comment”, “///comment” -> “/// comment”
clang-format doesn’t fix non-ASCII (e.g., Chinese) comments
NOTE: This only modifies actual comments, not // inside string literals
Uses the same detection logic as cpplint’s IsCppString function
Sourcepub fn fix_todo_comments(path: &Path) -> Result<()>
pub fn fix_todo_comments(path: &Path) -> Result<()>
Fix TODO comments using git blame for author Converts “TODO:” or “TODO(user):” to “TODO(blame_author):”
Sourcepub fn fix_lone_semicolon(path: &Path) -> Result<()>
pub fn fix_lone_semicolon(path: &Path) -> Result<()>
Fix lone semicolons: remove lines that contain only whitespace and a semicolon cpplint warns: “Line contains only semicolon.”
Sourcepub fn fix_long_comments(path: &Path, max_length: usize) -> Result<()>
pub fn fix_long_comments(path: &Path, max_length: usize) -> Result<()>
Fix long comment lines by breaking them at appropriate points Handles Chinese comments which clang-format can’t reflow properly
Sourcepub fn fix_pragma_separators(path: &Path) -> Result<()>
pub fn fix_pragma_separators(path: &Path) -> Result<()>
Fix pragma separator lines: convert “– – –” style to standard “#pragma mark -” format cpplint warns about “Extra space for operator –” but these are visual separators
Auto Trait Implementations§
impl Freeze for SourceFixer
impl RefUnwindSafe for SourceFixer
impl Send for SourceFixer
impl Sync for SourceFixer
impl Unpin for SourceFixer
impl UnsafeUnpin for SourceFixer
impl UnwindSafe for SourceFixer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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