Contraction Prevention Rule

This rule enforces the replacement of contractions with their full word equivalents in text. The rule is designed to maintain formal writing consistency and clarity, particularly in technical or professional documentation where contractions might be considered too casual or could potentially cause confusion for non-native English speakers.

The rule operates by identifying common English contractions and flagging them as errors, suggesting their full-word replacements. This aligns with many formal style guides that prefer explicit, uncontracted forms in professional writing.

Examples:

  • ❌ "It's important to configure the settings"

  • ✅ "It is important to configure the settings"

  • ❌ "Don't run this command as root"

  • ✅ "Do not run this command as root"

  • ❌ "We're updating the documentation"

  • ✅ "We are updating the documentation"

  • ❌ "Can't connect to the server"

  • ✅ "Cannot connect to the server"

The rule will flag any of the listed contractions in the text and suggest replacing them with their full word equivalents, helping maintain a more formal and professional writing style.

Rule Source

This rule comes from: https://github.com/mesosphere/dcos-docs-site

Rule Definition

extends: substitution
message: "Use '%s' instead of '%s'."
link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions
level: error
ignorecase: true
action:
  name: replace
swap:
  aren't: are not
  can't: cannot
  couldn't: could not
  didn't: did not
  don't: do not
  doesn't: does not
  hasn't: has not
  haven't: have not
  how's: how is
  isn't: is not
  it's: it is
  shouldn't: should not
  that's: that is
  they're: they are
  wasn't: was not
  we're: we are
  we've: we have
  weren't: were not
  what's: what is
  when's: when is
  where's: where is
  won't: will not