This PR adds an Ast-Grep rule that checks if an extra space has been added to a comment or string. The rule does purposely not match an arbitrary number of space so false positives are not emitted when whitespace is used for formatting. The rule is also limited to comments and string as rustfmt removes extra whitespace in the code except for comments and strings. If there are other AST nodes where rustfmt does not remove extra whitespace they should be added to this rule.
This PR adds an Ast-Grep rule that checks if an extra space has been added to a comment or string. The rule does purposely not match an arbitrary number of space so false positives are not emitted when whitespace is used for formatting. The rule is also limited to comments and string as
rustfmt
removes extra whitespace in the code except for comments and strings. If there are other AST nodes whererustfmt
does not remove extra whitespace they should be added to this rule.