27 lines
1.2 KiB
YAML
27 lines
1.2 KiB
YAML
# Microsoft Writing Style Guide:
|
|
# - Use bold formatting for UI element names, not quotation marks.
|
|
# - Omit trailing colons or ellipses from UI labels in instructions.
|
|
extends: existence
|
|
message: "Format UI labels in bold without quotes or trailing punctuation ('%s')."
|
|
link: https://learn.microsoft.com/en-us/style-guide/procedures-instructions/describing-interactions-with-ui
|
|
level: warning
|
|
scope: raw
|
|
ignorecase: true
|
|
nonword: true
|
|
tokens:
|
|
- '\b(?:select|choose|open|clear|go to|hover over)\s+"[^"\n]{1,40}"'
|
|
- '\b(?:select|choose|open|clear|go to|hover over)\s+\*\*[^*\n]{1,40}(?::|\.{3}|…)\*\*'
|
|
|
|
tests:
|
|
- name: flags quoted UI labels and trailing punctuation
|
|
input: |
|
|
Select "Save" or choose **Export...** and open **Settings:**.
|
|
want: |
|
|
1:1:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('Select "Save"').
|
|
1:18:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('choose **Export...**').
|
|
1:43:Archie.UILabelFormat:Format UI labels in bold without quotes or trailing punctuation ('open **Settings:**').
|
|
- name: accepts clean bold UI labels
|
|
input: |
|
|
Select **Save**, choose **Export**, and open **Settings**.
|
|
want: ""
|