This rule ensures that commas and periods are placed inside quotation marks, following standard American English punctuation rules. This is a common style requirement in technical writing, particularly in Google's style guide, as it helps maintain consistency and readability across documentation.
The rule specifically checks for cases where periods, commas, or question marks are incorrectly placed outside of quotation marks, which is a common error when writing technical documentation.
Examples:
❌ Incorrect (will be flagged):
- He said "hello".
- The command is "git push", and then...
- Did you say "hello"?
✅ Correct:
- He said "hello."
- The command is "git push," and then...
- Did you say "hello?"
The rule uses a regular expression pattern to detect quotation marks followed immediately by punctuation marks, which helps identify instances where the punctuation should be moved inside the quotes.