errata-ai / Microsoft

A Vale-compatible implementation of the Microsoft Writing Style Guide.
https://github.com/errata-ai/vale
MIT License
85 stars 46 forks source link

Apostrophes are doubled in the reported message #33

Closed AlexJitianu closed 3 years ago

AlexJitianu commented 3 years ago

I'm using the Microsoft Styleguide. I have content that triggers the Contractions.yml rule. In the reported message the apostrophes of the offending word get doubled:


  "Untitled1.md": [
    {
      "Action": {
        "Name": "replace",
        "Params": null
      },
      "Check": "Microsoft.Contractions",
      "Description": "",
      "Line": 3,
      "Link": "https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions",
      "Message": "Use ''doesn't'' instead of 'does not'.",
      "Severity": "error",
      "Span": [
        6,
        13
      ],
      "Match": "does not"
    },```

- OS Windows 10
- Install method Direct download
- Vale version 2.6.5
ghost commented 3 years ago

Does errata-ai/vale#282 apply in this case?

AlexJitianu commented 3 years ago

It looks like it. If I remove this part from Contractions.yml

action:
  name: replace

Then those additional quotes are gone. In my case there is only one proposal for replacement, so the additional quotes are not really needed:

swap:
  does not: doesn't
ghost commented 3 years ago

It's not a democracy, but if I was voting, I'd vote for Vale to put single quotes on %s variables in all cases and the message would never need single quotes around the variable. But, that would break all the existing messages...

"A foolish consistency is the hobgoblin of little minds"

jdkato commented 3 years ago

This will be fixed in the next release of the style.

jdkato commented 3 years ago

This was actually fixed in v2.6.6 of Vale (not this repo).