Add style workflow (#3909)

* Tweak rules

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Rule changes

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Remove the following and simple

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Revised rules and added tests

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Soft rollout with only spelling and terms

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Add Vale to readme

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Only lint modified and added files

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Remove run on workflow dispatch

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Removed only added and modified files

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Added please

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Changed min alert level to warning

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Don't fail on error and minor changes

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Remove fail on error

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Attempt to have vale not fail

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Fixed links

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>

* Update README.md

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

* Update README.md

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>

---------

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
This commit is contained in:
kolchfa-aws 2023-05-03 12:34:05 -04:00 committed by GitHub
parent 0235af562f
commit c9da6c07ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 1053 additions and 7 deletions

View File

@ -0,0 +1,71 @@
extends: conditional
message: "'%s': Spell out acronyms the first time that you use them on a page and follow them with the acronym in parentheses. Subsequently, use the acronym alone."
link: 'https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#acronyms'
level: warning
scope: summary
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{1,3}\/?[A-Z]{1,3}\d{0,2})\b'
second: '(?:\b[A-Za-z-]+ )+\(([A-Z]{1,3}\/?[A-Z]{1,3}\d{0,2})\)'
# ... with the exception of these:
exceptions:
- API
- ASCII
- BASIC
- BM25
- CPU
- DOS
- FAQ
- FTP
- GIF
- HTML
- HTTP
- HTTPS
- I/O
- ID
- IP
- JPEG
- JSON
- NAT
- NGINX
- PDF
- RAM
- REST
- RGB
- ROM
- SAML
- SDK
- SSL
- TCP
- TIFF
- TLS
- UI
- URI
- URL
- UTC
- UTF
- XML
- YAML
- CAT
- GET
- PUT
- POST
- DELETE
- AND
- OR
- KB
- MB
- GB
- TB
- PB
- US
- PNG
- JVM
- N/A
- GROUP
- BY
- SELECT
- HAVING
- SQL
- TOC
- 'NULL'

View File

@ -0,0 +1,8 @@
extends: existence
message: "Don't use a comma after single-word adverbs of time at the beginning of a sentence in '%s'."
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#punctuation-and-capitalization
level: error
ignorecase: false
nonword: true
tokens:
- '(?:(^|\s)(Then|Afterward|Later|Subsequently)),'

View File

@ -0,0 +1,6 @@
extends: existence
message: "Don't use an ampersand in place of 'and' in documentation."
nonword: true
level: warning
tokens:
- '\w +& +\w'

View File

@ -0,0 +1,5 @@
extends: existence
message: "Use 'cyber' as a prefix. Remove spaces or hyphens in '%s'."
level: error
tokens:
- '[Cc]yber[- ]+[a-z]*'

View File

@ -0,0 +1,7 @@
extends: existence
message: "There should be no spaces around the dash in '%s'."
ignorecase: true
nonword: true
level: error
tokens:
- '\w+ +-{2,3} +\w+'

View File

@ -0,0 +1,22 @@
extends: substitution
message: "Use '%s' instead of '%s' for versions or orientation within a document. Use 'above' and 'below' only for physical space or screen descriptions."
link: 'https://github.com/opensearch-project/documentation-website/blob/main/TERMS.md'
level: warning
ignorecase: true
swap:
- 'image below': 'following image'
- 'example below': 'following example'
- 'steps below': 'following steps'
- 'section below': 'following section'
- 'table below': 'following table'
- 'image above': 'following image'
- 'example above': 'preceding example'
- 'section above': 'preceding section'
- 'table above': 'preceding table'
- 'above image': 'preceding image'
- 'above section': 'preceding section'
- 'above table': 'preceding table'
- '\d+\.\d+\s+(?:and|or)\s+above': 'later'
- '\d+\.\d+\s+(?:and|or)\s+below': 'earlier'
- 'below(?!\s+(?:the|this|\d))': 'previous, preceding, or earlier'
- 'above(?!\s+(?:the|this|\d))': 'following or later'

View File

@ -0,0 +1,16 @@
extends: substitution
message: "Use '%s' instead of '%s' for window, page, or pane references to features or controls. Use 'top' and 'bottom' only as a general screen reference."
link: 'https://github.com/opensearch-project/documentation-website/blob/main/TERMS.md'
level: warning
ignorecase: true
action:
name: replace
swap:
- top left: upper left
- bottom left: lower left
- top right: upper right
- bottom right: lower right
- top-left: upper-left
- bottom-left: lower-left
- top-right: upper-right
- bottom-right: lower-right

View File

@ -0,0 +1,6 @@
extends: existence
message: "Don't use exclamation points in documentation."
nonword: true
level: error
tokens:
- '\w+!(?:\s|$)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'failover' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:fail over|fail-over)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'fail over' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:failover|fail-over)'

View File

@ -0,0 +1,7 @@
extends: existence
message: "'%s' is in future tense. Use present tense in documentation."
ignorecase: true
level: suggestion
scope: raw
tokens:
- '(?:will|is going to|won''t|[A-za-z]+''ll)\s+[a-z]+'

View File

@ -0,0 +1,11 @@
extends: existence
message: "'%s': Don't define acronyms in headings."
link: 'https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#acronyms'
level: error
ignorecase: false
scope: heading
nonword: true
action:
name: remove
tokens:
- '\([A-Z]{2,5}\)'

View File

@ -0,0 +1,5 @@
extends: capitalization
message: "'%s' is a heading and should be in sentence case."
level: error
scope: heading
match: $sentence

View File

@ -0,0 +1,7 @@
extends: existence
message: "Capitalize the word after a colon in '%s'."
nonword: true
level: error
scope: heading
tokens:
- '(?::\s)[a-z]+'

View File

@ -0,0 +1,9 @@
extends: existence
message: "Don't use punctuation at the end of a heading."
nonword: true
level: error
scope: heading
action:
name: remove
tokens:
- '[.?!]$'

View File

@ -0,0 +1,17 @@
extends: substitution
message: "Use '%s' instead of '%s' because the latter is an offensive term."
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#offensive-terms
ignorecase: true
level: error
swap:
'abort': stop, end, or cancel
'black day': blocked day
'blacklist': deny list
'execute': run, process, apply, start, launch, or initiate
'hang': stop responding
'kill': stop, end, clear, remove, or cancel
'master account': 'management account'
'master': cluster manager
'slave': replica, secondary, standby
'white day': open day
'whitelist': allow list

View File

@ -0,0 +1,10 @@
extends: existence
message: "Using '%s' is unnecessary. Remove."
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#basic-guidelines
ignorecase: true
nonword: true
level: warning
action:
name: remove
tokens:
- '\b(?:etc\.|etc)'

View File

@ -0,0 +1,15 @@
extends: substitution
message: "Use '%s' instead of '%s'."
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#basic-guidelines
ignorecase: true
level: warning
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)[\s,]': for example or such as
'\b(?:ie|i\.e\.)[\s,]': that is or specifically
'ad hoc': one-time
'\b(?:v\.|vs\.|vs|versus)': compared to or compared with
'via': using, through, by accessing, or by choosing
'vice versa': the other way around

View File

@ -0,0 +1,7 @@
extends: existence
message: "Add a trailing slash to the link '%s'."
level: error
nonword: true
scope: raw
tokens:
- '\(\{\{site.url\}\}\{\{site.baseurl\}\}(\/[A-Za-z0-9-_]+)+\s*\)'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Add a slash after '{{site.url}}/{{site.baseurl}}' in '%s'."
level: error
nonword: true
scope: raw
tokens:
- '\(\{\{site.url\}\}\{\{site.baseurl\}\}([^\/])(?:(.*))?\)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'login' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:log in|log-in)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'log in' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:login|log into|log on|log onto)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'logout' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:log out)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'log out' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:logout)'

View File

@ -0,0 +1,6 @@
extends: existence
message: "Resolve lingering merge conflicts."
nonword: true
level: error
tokens:
- '<<<<<<< HEAD'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Add an Oxford comma in '%s'."
scope: sentence
level: warning
nonword: true
tokens:
- '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]'

View File

@ -0,0 +1,45 @@
extends: existence
message: "'%s': Whenever possible, use the active voice instead of the passive voice."
ignorecase: true
level: suggestion
raw:
- \b(am|are|were|being|is|been|was|be)\b\s*
tokens:
- '[\w]+ed'
- become
- been
- begun
- brought
- built
- cast
- caught
- chosen
- come
- cut
- dealt
- done
- drawn
- forbidden
- found
- given
- gone
- gotten
- held
- hidden
- kept
- known
- led
- let
- made
- put
- quit
- read
- seen
- sent
- sped
- spent
- stuck
- swept
- taken
- understood
- written

View File

@ -0,0 +1,9 @@
extends: existence
message: "Using '%s' is unnecessary. Remove."
link: https://github.com/opensearch-project/documentation-website/blob/main/TERMS.md
ignorecase: true
level: warning
action:
name: remove
tokens:
- 'please'

View File

@ -0,0 +1,7 @@
extends: existence
message: "Use an en dash (--) with no space on either side in a range of numbers."
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#numbers-and-measurement
nonword: true
level: error
tokens:
- '\b\d+ *[-] *\d+\b'

View File

@ -0,0 +1,6 @@
extends: repetition
message: "'%s' is repeated."
level: error
alpha: true
tokens:
- '[^\s]+'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'rollover' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:roll over|roll-over)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'roll over' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:rollover|roll-over)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'setup' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:set up|set-up)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'set up' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:setup|set-up)'

View File

@ -0,0 +1,10 @@
extends: existence
message: "Don't use '%s' because it's not neutral in tone. If you mean 'only', use 'only' instead."
link: https://github.com/opensearch-project/documentation-website/blob/main/TERMS.md
ignorecase: true
level: warning
action:
name: remove
tokens:
- simply
- just

View File

@ -0,0 +1,9 @@
extends: existence
message: "There should be no space before and one space after the punctuation mark in '%s'."
level: error
nonword: true
tokens:
- '[A-Za-z]+[.?] {2,}[A-Za-z]+'
- '[A-Za-z]+[.?][A-Za-z]+'
- '[A-Za-z]+[,;] {2,}[A-Za-z]+'
- '[A-Za-z]+[,;][A-Za-z]+'

View File

@ -0,0 +1,6 @@
extends: existence
message: "When using '/' between words, do not insert space on either side of it."
ignorecase: true
level: error
tokens:
- '[A-Za-z]+ +\/ +[A-Za-z]+'

View File

@ -0,0 +1,6 @@
extends: existence
message: "There should be once space between words in '%s'."
level: error
nonword: true
tokens:
- '[A-Za-z]+ {2,}[A-Za-z]+'

View File

@ -0,0 +1,5 @@
extends: spelling
message: "%s"
level: error
action:
name: suggest

View File

@ -0,0 +1,24 @@
extends: script
message: "Do not stack headings. Insert an introductory sentence between headings."
level: error
link: https://github.com/opensearch-project/documentation-website/blob/main/STYLE_GUIDE.md#formatting-and-organization
scope: raw
script: |
text := import("text")
matches := []
// Replace code blocks with dummy text to avoid processing comments
document := text.re_replace("(?s) *(```.*?```)", scope, "text")
isHeading := false
for line in text.split(document, "\n") {
if text.trim_space(line) != "" {
if text.has_prefix(line, "#") {
if isHeading == true {
start := text.index(scope, line)
matches = append(matches, {begin: start, end: start + len(line)})
}
isHeading = true // new section; reset count
} else {
isHeading = false
}
}
}

View File

@ -0,0 +1,48 @@
extends: substitution
message: "Use '%s' instead of '%s'."
ignorecase: true
level: error
action:
name: replace
swap:
'command-line interface': command line interface
'data are': data is
'data set': dataset
'for information on': for information about
'for more information on': for more information about
'geo hash': geohash
'geo point': geopoint
'geo shape': geoshape
'geospacial': geospatial
'hard code': hardcode
'high-performance computing': high performance computing
'host name': hostname
'Huggingface': Hugging Face
'indices': indexes
'keystore': key store
'kmeans': k-means
'kNN': k-NN
'machine-learning': machine learning
'nonproduction': non-production
'postmigration': post-migration
'pre-configure': preconfigure
'pre-configured': preconfigured
'pre-defined': predefined
'pre-train': pretrain
'pre-trained': pretrained
'premigration': pre-migration
're-enable': reenable
'screen shot': screenshot
'sample request': example request
'sample response': example response
'stacktrace': stack trace
'stand-alone': standalone
'timeframe': time frame
'time series data': time-series data
'time stamp': timestamp
'timezone': time zone
'truststore': trust store
'U.S.': US
'web page': webpage
'web site': website
'user interface \(UI\)': UI

View File

@ -0,0 +1,16 @@
extends: substitution
message: "Use '%s' instead of '%s'."
ignorecase: true
level: suggestion
action:
name: replace
swap:
'app server': application server
'as well as': and
'due to': because of
'it is recommended': we recommend
'leverage': use
'life cycle': lifecycle
'navigate in': navigate to
'wish|desire': want

View File

@ -0,0 +1,5 @@
extends: capitalization
message: "'%s' is a table heading and should be in sentence case."
level: error
scope: table.header
match: $sentence

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'timeout' as an adjective or noun instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: NN|JJ
pattern: '(?:time out|time-out)'

View File

@ -0,0 +1,7 @@
extends: sequence
message: "Use 'time out' as a verb instead of '%s'."
level: error
ignorecase: true
tokens:
- tag: VB|VBD|VBG|VBN|VBP|VBZ
pattern: '(?:timeout|time-out)'

View File

@ -0,0 +1,12 @@
extends: substitution
message: "Use '%s' instead of '%s'."
level: error
ignorecase: false
action:
name: replace
swap:
kb: KB
mb: MB
gb: GB
tb: TB
pb: PB

View File

@ -0,0 +1,8 @@
extends: existence
message: "Put a space between the number and the units in '%s'."
nonword: true
ignorecase: true
level: warning
tokens:
- \d+(?:B|KB|MB|GB|TB|PB)(?:\s|\.|,)
- \d+(?:ns|ms|s|min|h|d)(?:\s|\.|,)

View File

@ -0,0 +1,6 @@
extends: existence
message: "In '%s', spell out 'version'."
ignorecase: true
level: warning
tokens:
- '[v|V][0-9]+\.[0-9]+'

View File

@ -0,0 +1 @@
(?-i)[A-Z]{2,}s

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,25 @@
Alerting plugin
Anomaly Detection plugin
Asynchronous Search plugin
Cross-Cluster Replication plugin
Maps plugin
Notebooks plugin
Notifications plugin
Reports plugin
Reports Scheduler plugin
Geospatial plugin
Index Management plugin
Job Scheduler
Job Scheduler plugin
k-NN plugin
ML Commons
ML Commons plugin
Neural Search plugin
Observability plugin
Performance Analyzer plugin
Query Workbench plugin
Search Relevance plugin
Security plugin
Security Analytics plugin
SQL plugin
Trace Analytics plugin

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,80 @@
Active Directory
Adoptium
Amazon
Amazon OpenSearch Serverless
Amazon OpenSearch Service
Ansible
Auditbeat
AWS Cloud
Cognito
Dashboards Query Language
Data Prepper
Debian
Dev Tools
Docker
Docker Compose
Dockerfile
DoS
Elasticsearch
GeoJSON
GitHub
Gradle
Grafana
Faiss
Filebeat
Fluent Bit
Fluentd
Helm
Hugging Face
Inferentia
IPv4
IPv6
Iris
JavaScript
Jaeger
Jaeger HotROD
Keycloak
Kerberos
Kibana
Kubernetes
Lambda
Linux
Log4j
Logstash
Lucene
macOS
Metricbeat
Microsoft Power BI
Minikube
Nagios
Okta
Open Distro
OpenID Connect
OpenSearch
OpenSearch Dashboards
OpenSearch Project
OpenSearch Service
OpenSSL
OpenTelemetry
OpenTelemetry Collector
OTel
Packetbeat
Painless
Peer Forwarder
Performance Analyzer
Piped Processing Language
Point in Time
Powershell
Python
PyTorch
Querqy
Query Workbench
RPM Package Manager
Ruby
Sigv4
Simple Schema for Observability
Tableau
TorchScript
Tribuo
VisBuilder
Winlogbeat

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,106 @@
[Aa]nonymization
[Aa]utomapping
[Aa]utopopulate
[Bb]ackoff
[Bb]ackpressure
[Bb]asemap
[Bb]igram
Boolean
[Cc]allout
[Cc]odec
[Cc]omposable
[Cc]ron
[Cc]ybersecurity
[Dd]atagram
[Dd]eallocate
[Dd]eduplication
[Dd]eserialize
[Dd]eserialization
Dev
Distro
[Ee]gress
[Ee]num
[Ff]ailover
[Ff]lyout
[Ff]sync
Gantt
[Gg]eodistance
[Gg]eohash
GeoHex
[Gg]eopoint
[Gg]eopolygon
[Gg]eoshape
[Gg]eospatial
gibibyte
[Hh]ashmap
[Hh]ostname
[Ii]mpactful
[Ii]ngress
[Ii]nitializer
[Ii]nstrumentations?
[Ii]ntracluster
[Jj]avadoc
k-NN
[Kk]eystore
kibibyte
mebibyte
[Ll]emmatization
Levenshtein
[Ll]inestring
[Ll]ookups?
[Ll]ossy
[Ll]owercases?d?
[Mm]isorder
[Mm]ultifield
[Mm]ultiline
[Mm]ultipoint
[Mm]ultipolygon
[Mm]ultithreaded
[Mm]ultivalued
[Nn]amespace
pebibyte
[Pp]luggable
[Pp]reconfigure
[Pp]refilter
[Pp]reload
[Pp]repend
[Pp]repper
[Pp]reprocess
[Pp]retrain
[Rr]ebalance
[Rr]ebalancing
[Rr]eenable
[Rr]eindex
[Rr]eingest
[Rr]epo
[Rr]ollup
[Rr]unbooks?
[Ss]erverless
[Ss]ignificand
stdout
[Ss]ubaggregation
[Ss]ubcalculation
[Ss]ubcommands?
[Ss]ubfield
[Ss]ubquery
[Ss]ubtag
[Ss]ubtree
[Ss]ubvector
[Ss]uperset
tebibyte
[Tt]emplated
[Tt]okenization
[Tt]okenizer?
[Tt]ooltip
[Tt]ranslog
[Uu]nary
[Uu]ncheck
[Uu]ncomment
[Uu]nigram
[Uu]nnesting
[Uu]nrecovered
[Uu]pdatable
[Uu]psert
[Ww]alkthrough
[Ww]ebpage
xy

View File

@ -0,0 +1 @@

87
.github/vale/tests/test-style-neg.md vendored Normal file
View File

@ -0,0 +1,87 @@
# Test file
This sentence tests Advanced Placement (AP). We should define AP before using.
Then this sentence tests adverbs of time.
This sentence tests cybersecurity.
This sentence tests dash---spacing.
This sentence tests numbers above 1.2 in versions 1.2 and earlier.
This sentence tests upper-right and lower left.
This sentence tests exclamation points.
This sentence tests failover. To fail over, we test this as a verb.
This sentence is not testing the future tense.
## This heading tests heading acronyms Security plugin
This sentence tests inclusive terminology by not using offensive terms.
## This heading tests capitalization
This sentence tests Latin elimination.
## This heading tests ending punctuation
This sentence tests Latin substitution through using Latin.
## This heading: Tests colons but fails capitalization
This sentence tests [links end slash]({{site.url}}{{site.baseurl}}/opensearch/).
This sentence tests [links mid slash]({{site.url}}{{site.baseurl}}/opensearch/).
This sentence tests using login as a noun. To log in, we test this as a verb.
To test merge conflicts, remove tick marks in `<<<<<<< HEAD`.
This sentence tests periods, colons, and commas.
This sentence tests passive voice.
We are pleased that this sentence tests pleading.
This sentence tests the range 2--5.
This sentence tests repetition of words in the middle of a sentence.
This sentence tests rollover as a noun. To roll over, we test this as a verb.
This sentence tests setup as a noun. To set up, we test this as a verb.
This sentence tests the "simple" rule by doing it.
These two sentences. Test the spacing punctuation.
This sentence tests the correct/incorrect slash spacing.
This sentence tests word spacing.
This sentence tests spelling.
## This and the next
This sentence tests substitution error by using the word indexes.
### Headings test stacked headings
This sentence tests substitution suggestion because of its nature.
This table | Tests capitalization
:--- | :---
of table | headings
This sentence tests timeout as a noun. To time out, we test this as a verb.
This sentence tests 2 KB units capitalization.
This sentence tests 2 KB units spacing.
This sentence tests version 1.2 not spelled out.
This sentence tests terms by using Security plugin.

89
.github/vale/tests/test-style-pos.md vendored Normal file
View File

@ -0,0 +1,89 @@
# Test file
This sentence tests AP. AP should be defined before using.
Then, this sentence tests adverbs of time.
This sentence tests cyber security.
This sentence tests dash --- spacing.
This sentence tests the table above in versions 1.2 and below.
This sentence tests top-right and bottom left.
This sentence tests exclamation points!
This sentence tests fail-over. To failover, we test this as a verb.
This sentence will test the future tense.
## This heading tests heading acronyms (HA)
This sentence tests inclusive terminology by using an offensive term kill.
## This heading tests Capitalization
This sentence tests Latin elimination, etc.
## This heading tests ending punctuation.
This sentence tests Latin substitution via using Latin.
## This heading: tests colons
This sentence tests [links end slash]({{site.url}}{{site.baseurl}}/opensearch).
This sentence tests [links mid slash]({{site.url}}{{site.baseurl}}opensearch).
This sentence tests log-in as a noun. To login, we test this as a verb.
To test merge conflicts, remove tick marks in `<<<<<<< HEAD`.
This sentence tests periods, colons and commas.
This sentence is tested with passive voice.
Please test this sentence.
This sentence tests the range 2 -- 5.
This sentence tests repetition repetition of words in the middle of a sentence.
This sentence tests roll-over as a noun. To rollover, we test this as a verb.
This sentence tests set-up as a noun. To setup, we test this as a verb.
This sentence simply tests the "simple" rule by just doing it.
These two sentences. Test the spacing punctuation.
This sentence tests the correct / incorrect slash spacing.
This sentence tests word spacing.
This sentence tests splling.
## This and the next
### Headings test stacked headings
This sentence tests substitution error by using the word indices.
This sentence tests substitution suggestion due to its nature.
This Table | tests capitalization
:--- | :---
of table | headings
This sentence tests time-out as a noun. To timeout, we test this as a verb.
This sentence tests 2 kb units capitalization.
This sentence tests 2KB units spacing.
This sentence tests v1.2 not spelled out.
This sentence tests terms by using security plugin.
This sentence tests using the word repo.

22
.github/workflows/vale.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Style check
on:
pull_request:
workflow_dispatch:
jobs:
style-job:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Run Vale
uses: errata-ai/vale-action@reviewdog
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
fail_on_error: false
reporter: github-pr-check
filter_mode: file
vale_flags: "--no-exit"

68
.vale.ini Normal file
View File

@ -0,0 +1,68 @@
StylesPath = ".github/vale/styles"
Vocab = "OpenSearch"
MinAlertLevel = warning
SkippedScopes = code, style
[*.md]
BasedOnStyles = Vale, OpenSearch
BlockIgnores = {%-?\s*comment[.|\s|\S]*?endcomment\s*-?%}, \
{%\s*raw[.|\s|\S]*?endraw\s*%}, \
{:+\s*[\.\w-\s]*\s*}, \
{%\s+[^%]*%}
# ignore variables
TokenIgnores = [a-zA-Z_]+((?:_|\.)[a-zA-Z]+)+
# override Vale spelling
Vale.Spelling = NO
Vale.Repetition = NO
Vale.Terms = YES
OpenSearch.AcronymParentheses = NO
OpenSearch.AdverbsOfTime = NO
OpenSearch.Ampersand = NO
OpenSearch.Cyber = NO
OpenSearch.DashSpacing = NO
OpenSearch.DirectionAboveBelow = NO
OpenSearch.DirectionTopBottom = NO
OpenSearch.Exclamation = NO
OpenSearch.FailoverNoun = NO
OpenSearch.FailoverVerb = NO
OpenSearch.FutureTense = NO
OpenSearch.HeadingAcronyms = NO
OpenSearch.HeadingCapitalization = NO
OpenSearch.HeadingColon = NO
OpenSearch.HeadingPunctuation = NO
OpenSearch.Inclusive = NO
OpenSearch.LatinismsElimination = NO
OpenSearch.LatinismsSubstitution = NO
OpenSearch.LinksEndSlash = NO
OpenSearch.LinksMidSlash = NO
OpenSearch.LoginNoun = NO
OpenSearch.LoginVerb = NO
OpenSearch.LogoutNoun = NO
OpenSearch.LogoutVerb = NO
OpenSearch.MergeConflicts = NO
OpenSearch.OxfordComma = NO
OpenSearch.PassiveVoice = NO
OpenSearch.Please = NO
OpenSearch.Range = NO
OpenSearch.Repetition = NO
OpenSearch.RolloverNoun = NO
OpenSearch.RolloverVerb = NO
OpenSearch.SetupNoun = NO
OpenSearch.SetupVerb = NO
OpenSearch.Simple = NO
OpenSearch.SpacingPunctuation = NO
OpenSearch.SpacingSlash = NO
OpenSearch.SpacingWords = NO
OpenSearch.Spelling = YES
OpenSearch.StackedHeadings = NO
OpenSearch.SubstitutionsError = NO
OpenSearch.SubstitutionsSuggestion = NO
OpenSearch.TableHeadings = NO
OpenSearch.TimeoutNoun = NO
OpenSearch.TimeoutVerb = NO
OpenSearch.UnitsNames = NO
OpenSearch.UnitsSpacing = NO
OpenSearch.Version = NO

View File

@ -134,6 +134,15 @@ We also provide guidelines on terminology. For a list of OpenSearch terms, see [
The OpenSearch documentation uses a modified version of the [just-the-docs](https://github.com/pmarsceill/just-the-docs) Jekyll theme. For an overview of the commonly used formatted elements, including callouts, videos, and buttons, see the [FORMATTING_GUIDE](FORMATTING_GUIDE.md).
## Style linting
We use the [Vale](https://github.com/errata-ai/vale) linter to ensure that our documentation adheres to the [OpenSearch Project Style Guidelines](STYLE_GUIDE.md). To install Vale locally, follow these steps:
1. Run `brew install vale`.
2. Run `vale *` from the documentation site root directory to lint all Markdown files. To lint a specific file, run `vale /path/to/file`.
Optionally, you can install the [Vale VSCode](https://github.com/chrischinchilla/vale-vscode) extension that integrates Vale with Visual Studio Code. By default, only _errors_ and _warnings_ are underlined. To change the minimum alert level to include _suggestions_, go to **Vale VSCode** > **Extension Settings** and select **suggestion** in the **Vale > Vale CLI: Min Alert Level** dropdown list.
## Code of conduct
This project has adopted an [Open Source Code of Conduct](https://opensearch.org/codeofconduct.html).

View File

@ -27,7 +27,7 @@ distance_type | enum, such as `EUCLIDEAN`, `COSINE`, or `L1` | The type of measu
### APIs
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-model)
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#training-a-model)
* [Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#predict)
* [Train and predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-and-predict)
@ -77,7 +77,7 @@ optimizerType | OptimizerType | The optimizer used in the model. | SIMPLE_SGD
### APIs
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-model)
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#training-a-model)
* [Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#predict)
### Example
@ -189,7 +189,7 @@ time_zone | string | The time zone for the `time_field` field. | "UTC"
### APIs
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-model)
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#training-a-model)
* [Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#predict)
* [Train and predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-and-predict)
@ -211,7 +211,7 @@ RCFSummarize is a clustering algorithm based on the Clustering Using REpresentat
### APIs
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-model)
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#training-a-model)
* [Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#predict)
* [Train and predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-and-predict)
@ -429,7 +429,7 @@ A classification algorithm, logistic regression models the probability of a disc
### APIs
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#train-model)
* [Train]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#training-a-model)
* [Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api/#predict)
### Example: Train/Predict with Iris data

View File

@ -74,7 +74,7 @@ plugins.ml_commons.max_model_on_node: 10
## Set sync job intervals
When returning runtime information with the [Profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#profile), ML Commons will run a regular job to sync newly deployed or undeployed models on each node. When set to `0`, ML Commons immediately stops sync-up jobs.
When returning runtime information with the [Profile API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#returning-model-profile-information), ML Commons will run a regular job to sync newly deployed or undeployed models on each node. When set to `0`, ML Commons immediately stops sync-up jobs.
### Setting

View File

@ -12,7 +12,7 @@ ML Commons for OpenSearch eases the development of machine learning features by
Interaction with the ML Commons plugin occurs through either the [REST API]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api) or [`ad`]({{site.url}}{{site.baseurl}}/search-plugins/sql/ppl/functions#ad) and [`kmeans`]({{site.url}}{{site.baseurl}}/search-plugins/sql/ppl/functions#kmeans) Piped Processing Language (PPL) commands.
Models [trained]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#train-model) through the ML Commons plugin support model-based algorithms such as kmeans. After you've trained a model enough so that it meets your precision requirements, you can apply the model to [predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#predict) new data safely.
Models [trained]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#training-a-model) through the ML Commons plugin support model-based algorithms such as kmeans. After you've trained a model enough so that it meets your precision requirements, you can apply the model to [predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#predict) new data safely.
Should you not want to use a model, you can use the [Train and Predict]({{site.url}}{{site.baseurl}}/ml-commons-plugin/api#train-and-predict) API to test your model without having to evaluate the model's performance.