Skip to content

Commit

Permalink
Add rules
Browse files Browse the repository at this point in the history
  • Loading branch information
theletterf committed Oct 6, 2022
1 parent 3594801 commit 605eac2
Show file tree
Hide file tree
Showing 26 changed files with 193 additions and 28 deletions.
15 changes: 14 additions & 1 deletion styles/Splunk/Acronyms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,17 @@ exceptions:
- WCR
- CLR
- ASP
- ASP.NET
- ASP.NET
- LCP
- TTFB
- XHR
- SPA
- CLS
- CLR
- AJAX
- FID
- TLS
- ITE
- KPI
- ITSI
- IT
9 changes: 9 additions & 0 deletions styles/Splunk/Backend-Frontend-Adjective.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: sequence
message: "Use %[1]s-%[2]s %[3]s, as %[1]s-%[2]s is an adjective here."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- pattern: '(?:back|front)'
- pattern: 'end'
- tag: NN
8 changes: 8 additions & 0 deletions styles/Splunk/Backend-Frontend-Noun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Hyphenate %[1]s, as %[1]s is an adjective here."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- pattern: '(?:backend|frontend)'
- tag: NN
6 changes: 3 additions & 3 deletions styles/Splunk/Decimals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ extends: existence
message: Use American-style formatting for commas and decimal points in numbers.
link: https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Decimals
ignorecase: true
level: error
level: warning
nonword: true
tokens:
- '\s\d{1,}\.\d{3,}'
- '\,?\d{4,}\,?'
- '[^\.]\d{1,}\.\d{3,}[^\.]'
- '(\d{3}[-\.]?\d{3}[-\.]?\d{4})[^\w]'
17 changes: 17 additions & 0 deletions styles/Splunk/DeviceAgnosticism.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends: substitution
message: "Avoid device-specific language. Use '%s' instead of '%s'."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Deviceagnosticism'
level: error
ignorecase: true
action:
name: replace
swap:
'click': select
'choose': select
'hit': select
'long press': If there are multiple ways a user can interact with a touch screen, use an input-agnostic term like "select and hold".
'pinch': If there are multiple ways a user can interact with a touch screen, use an input-agnostic term like "zoom out".
'press': select
'spread': If there are multiple ways a user can interact with a touch screen, use an input-agnostic term like "zoom in".
'tap': If there are multiple ways a user can interact with a touch screen, use an input-agnostic term like "select".
'(?<!agent |connection |data |device |event |file |issue |license |metric |monitor |resource |source )type(?! of)': Use "enter" to refer to the inputting of text.
3 changes: 1 addition & 2 deletions styles/Splunk/Directional.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
extends: existence
message: "Verify your use of '%s' with the Usage Dictionary."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Overview#Writing'
level: suggestion
ignorecase: true
tokens:
- above
- click
- below
- left
- right
1 change: 1 addition & 0 deletions styles/Splunk/DontUse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tokens:
- please
- premium solutions
- quite
- realtime
- recommend
- recommended
- remember
Expand Down
8 changes: 8 additions & 0 deletions styles/Splunk/Drilldown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use drilldown as an adjective or noun."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:drill down|drill-down)'
8 changes: 8 additions & 0 deletions styles/Splunk/DrilldownVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use drill down as a verb."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:drilldown|drill-down)'
1 change: 1 addition & 0 deletions styles/Splunk/Exclamation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
extends: existence
message: "Don't use exclamation points in text."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Exclamationpoints'
nonword: true
level: error
tokens:
Expand Down
8 changes: 8 additions & 0 deletions styles/Splunk/Failover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use failover as an adjective or noun."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:fail-over|fail over)'
8 changes: 8 additions & 0 deletions styles/Splunk/FailoverVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use fail over as a verb."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:failover)'
19 changes: 18 additions & 1 deletion styles/Splunk/Headings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,28 @@ exceptions:
- npm
- curl
- Instrumentation
- Internet
- Explorer
- CDN
- WebViews
- .NET
- ASP
- SignalFx
- IIS
- Azure
- App
- Service
- WebJobs
- WebJobs
- IT
- Service
- Intelligence
- WebEngine
- Universal
- Nuxt.js
- Next.js
- SPA
- SPAs
- Database
- Performance
- DB
- Monitor
3 changes: 2 additions & 1 deletion styles/Splunk/Inclusivity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ swap:
abnormal: atypical or not typical
blacklist: deny list, reject, deny, or exclude
dummy data: placeholder data
execute: run
flesh-colored: dark brown, cream, or beige
skin-toned: dark brown, cream, or beige
first-class: top-level
grandfathered: exempt
hangs: stops or freezes
hit: click, enter, or tap
hit: enter
illegal characters: special characters
mankind: all, everyone, humanity, or humankind
master: manager, primary, or main
Expand Down
9 changes: 9 additions & 0 deletions styles/Splunk/Install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: sequence
message: "Don't use install as a noun or adjective. Use installation instead."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
nonword: false
tokens:
- tag: NN|NNP|NNPS|NNS|JJ|JJR|JJS
pattern: 'install(?:\s|$)'
10 changes: 5 additions & 5 deletions styles/Splunk/Latin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ message: "Use '%s' instead of '%s'."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/USspelling'
ignorecase: true
level: error
nonword: false
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)[\s,]': for example
'\b(?:ie|i\.e\.)[\s,]': that is
'ad-hoc': if needed
'et al': and others
'etc': and so on
'via': through or by using
'[\s]et al[\s]': and others
'[\s]etc[\s|.]': and so on
'[\s]via[\s]': through or by using
'vice versa': and the reverse
'vs': versus
'[\s]vs[\s|.]': versus
6 changes: 6 additions & 0 deletions styles/Splunk/LoginVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: sequence
message: "Use log in as a verb. Don't use log on."
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:log into|log in|login|log on)'
8 changes: 8 additions & 0 deletions styles/Splunk/Lookup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use lookup as an adjective or noun."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: NN|NNP|NNPS|NNS|JJR|JJ|JJS
pattern: '(?:look-up|look up)'
8 changes: 8 additions & 0 deletions styles/Splunk/LookupVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use look up as a verb."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:lookup)'
13 changes: 13 additions & 0 deletions styles/Splunk/LowercaseX.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: existence
message: 'Use a lowercase "x" in HTTP status codes and product version numbers.'
link: https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary
ignorecase: false
level: error
tokens:
- '[0-9]+[X]+[X]'
- '[0-9]+[X]+[x]'
- '[0-9]+[x]+[X]'
- '[0-9]+\.[0-9]+\.[X]'
- '[0-9]+\.[X]'
- '[0-9]+[0-9]+\.[X]'
- '[0-9]+[0-9]+\.[0-9]+\.[X]'
2 changes: 1 addition & 1 deletion styles/Splunk/Numbers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ignorecase: true
level: warning
scope: sentence
tokens:
- '\s\d\s'
- '\s\d\s(?!hours|seconds|weeks|months|years|minutes)'
- '3rd-party'
- '3rd party'
- '^\d'
8 changes: 8 additions & 0 deletions styles/Splunk/Plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use plugin as an adjective or noun."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: 'plug-in'
8 changes: 8 additions & 0 deletions styles/Splunk/PluginVerb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use plug in as a verb."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:plug-in|plugin)'
8 changes: 8 additions & 0 deletions styles/Splunk/Realtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: sequence
message: "Use real-time %[3]s, as real-time is an adjective here."
link: 'https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary'
level: error
tokens:
- pattern: 'real'
- pattern: 'time'
- tag: NN
4 changes: 2 additions & 2 deletions styles/Splunk/Version.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends: existence
message: 'Spell out "version" instead of abbreviating with a "v"'
message: 'Spell out "version" instead of abbreviating with a "v".'
link: https://docs.splunk.com/Documentation/StyleGuide/current/StyleGuide/Usagedictionary
ignorecase: true
level: error
tokens:
- '[v|V][0-9]+\.[0-9]+'
- '[v|V][0-9]+\.[0-9]+'
Loading

0 comments on commit 605eac2

Please sign in to comment.