Skip to content

Commit

Permalink
Add tweaks to rules from usage (#26)
Browse files Browse the repository at this point in the history
* Add tweaks to rules from usage

* Pull in changed from qiskit-ibm-runtime

* Switch to regex and fix tests
  • Loading branch information
frankharkins authored Aug 21, 2023
1 parent 01ebd01 commit a2fd971
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 17 deletions.
5 changes: 5 additions & 0 deletions IBMQuantum/Contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends: existence
message: "Remove the hyphen in '%s'."
level: suggestion
tokens:
- 'non-(\w+)'
3 changes: 1 addition & 2 deletions IBMQuantum/However.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
extends: existence
message: Double-check your punctuation around 'however' (see github.com/IBM/ibm-quantum-style-guide/issues/10 for more information).
level: suggestion
code: false
ignorecase: true
ignorecase: false
raw:
- ([^;,] however|however[^,])
19 changes: 8 additions & 11 deletions IBMQuantum/Links.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
extends: existence
message: Link names should make sense without context; change "%s" to something more descriptive.
level: suggestion
code: false
scope: link
scope: raw
ignorecase: true
tokens:
- click here
- here
- link
- more
- more information
- page
- read more
- this link
- this page
# Manually match markdown / rst links
- '(?<=\[)(click )?here(?=\](\s*?)\()'
- '(?<=`)(click )?here(?=((\s*?)<(.+?)>)?`_)'
- '(?<=\[)(read )?more( information)?(?=\](\s*?)\()'
- '(?<=`)(read )?more( information)?(?=((\s*?)<(.+?)>)?`_)'
- '(?<=\[)(this )?(link|page)(?=\](\s*?)\()'
- '(?<=`)(this )?(link|page)(?=((\s*?)<(.+?)>)?`_)'
2 changes: 1 addition & 1 deletion IBMQuantum/Politeness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ link: 'https://github.com/IBM/ibm-quantum-style-guide/issues/16'
ignorecase: true
level: error
tokens:
- please
- 'please(?!\swait)'
- thanks
- thank you
3 changes: 1 addition & 2 deletions IBMQuantum/Terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ swap:
'pop-up (?:blocker|killer)': software to block pop-up ad windows
're(?:-)?occur': recur
'sort(?:-|/)?merge': sort|merge
'do(?: )(?!not|so)': complete|perform

bottom: end|last
below: following
Expand Down Expand Up @@ -143,6 +142,7 @@ swap:
secondary storage: auxiliary storage
selection button: left mouse button
serial database: nonpartitioned database environment
set-up: setup
shift-click: press Shift and click
ship: include|included
Simple Object Access Protocol: SOAP
Expand All @@ -162,7 +162,6 @@ swap:
toggle off: toggle
tooling: tools
touchscreen: touch-sensitive screen
transition: make the transition|move|migrate|change
transparent: indiscernible|not visible
typo: typing error|typographical error
uncheck: clear
Expand Down
10 changes: 10 additions & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Abelian
Abhinav
Aer
Akira
Alain
Amyra
Andersson
Andriyash
Expand All @@ -17,6 +18,7 @@ Bergholm
Bernagozzi
Bertels
Bertet
Bluemix
Boeblingen
Boixo
Boulant
Expand Down Expand Up @@ -69,6 +71,7 @@ Hiptmair
Hoyer
Hubregtsen
Ijaz
Ising
Iten
Izaac
Jakob
Expand Down Expand Up @@ -154,6 +157,7 @@ Vion
Vivek
Vojtech
Volkoff
Watrous
Weedbrook
Wierichs
Woerner
Expand Down Expand Up @@ -188,9 +192,11 @@ eigensolver
eigensolvers
eigenstate
eigenstates
enablement
endian
exponentials
expressibility
extremal
fanout
fermionic
fidelities
Expand All @@ -208,6 +214,7 @@ orthonormality
parameterization
polynomially
preprint
presigned
priori
pseudocode
qiskit
Expand All @@ -222,6 +229,7 @@ qutrits
recalibrated
reuploading
satisfiability
serverless
simulability
subfield
subfields
Expand All @@ -231,6 +239,7 @@ substrings
sudoku
summand
summands
timestep
tooltip
tooltips
transmon
Expand All @@ -243,3 +252,4 @@ transpiling
tridiagonal
trits
unitaries
untrusted
1 change: 0 additions & 1 deletion features/rules.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Feature: Rules
"""
test.md:3:13:IBMQuantum.Terms:Use 'end' or 'last' rather than 'bottom'
test.md:5:11:IBMQuantum.Terms:Use 'several' rather than 'a number of'
test.md:7:9:IBMQuantum.Terms:Use 'complete' or 'perform' rather than 'do'
test.md:11:10:IBMQuantum.Spelling:Unknown word 'algorihm'; fix or add to dictionary.
test.md:15:24:IBMQuantum.Terms:Use 'following' rather than 'below'
test.md:19:29:IBMQuantum.However:Double-check your punctuation around 'however' (see github.com/IBM/ibm-quantum-style-guide/issues/10 for more information).
Expand Down
1 change: 1 addition & 0 deletions fixtures/Other/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a sentence with a non-contracted word.

0 comments on commit a2fd971

Please sign in to comment.