From dd30d344758237b9f3130365c3309a03d86923a9 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Tue, 28 Nov 2023 11:36:32 +0000 Subject: [PATCH 1/2] Document and enforce spelling policy Define spelling for docs and spec as en_US. Add a CI job to enforce that and fix a couple of inconsistent spellings. A custom dictionary is maintained at .spellcheck-en-custom.txt Signed-off-by: Andrea Frittoli --- .github/workflows/main.yml | 10 +- .spellcheck-en-custom.txt | 239 +++++++++++++++++++++++++++++++++++++ .spellcheck.yml | 11 ++ core.md | 8 +- spec.md | 5 + testing-events.md | 4 +- 6 files changed, 270 insertions(+), 7 deletions(-) create mode 100644 .spellcheck-en-custom.txt create mode 100644 .spellcheck.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3949613b..224b15fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: VALIDATE_MARKDOWN: true jsonschema: - name: Validate examples + name: Validate Examples runs-on: ubuntu-latest steps: @@ -47,3 +47,11 @@ jobs: - name: Validate Examples run: ./tools/verify-examples.sh + + spellcheck: + name: Spellcheck (en_US) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: igsekor/pyspelling-any@v0.0.2 + name: Spellcheck \ No newline at end of file diff --git a/.spellcheck-en-custom.txt b/.spellcheck-en-custom.txt new file mode 100644 index 00000000..2111a88c --- /dev/null +++ b/.spellcheck-en-custom.txt @@ -0,0 +1,239 @@ +Auth +BD +CDEvent +CDEvents +CDF +CVE +CamelCase +CloudEvent +CloudEvents +Enum +FHbGphQ +FidWxhcnkgZGVmaW +Gerrit +Github +Gitlab +JSON +JXRmtaU +JoY +KH +KyjITcZXHotdMB +MEYCIQCBT +MergeRequest +MnY +MyPipeline +NGua +NIST +NZSh +Notational +PGRhdGE +PullRequest +QXFaWFpsYm +README +RIbHdaWE +RZ +RhdGE +SCM +SDKs +SIG +SKZ +SRE +Schemas +Tekton +TestOrg +TestRepo +TestSuite +URI +UUID +VGhlIHZvY +VZ +ViamVjdHMqCg +VkdobElIWnZZMkZpZFd +Whitepaper +WmlBcWMzVmlhbVZqZEhNcUNnPT +XiQlc +ZtYVc +aGNua +aGljaCBhcmUgbWFkZSBvZiAqc +aWhyZjVwb +aa +abc +abcde +aca +additionalProperties +aed +american +anUyNDRvazdkdWpfMjAyMjAyMjJUMTYwMDAwWiBhbmRyZWEuZnJpdHRvbGlAbQ +andrea +api +apis +artifactId +bGN +bd +bml +br +cSpell +cardpane +cb +cbdf +ccb +cd +cdeliveryfdn +cdevent +cdevents +cdfoundation +cdsystem +ce +charset +ci +cloudevents +clusterA +contentEncoding +contenttype +csrc +customData +customDataContentType +customDataEncoding +customdata +customdatacontenttype +daR +daemonset +datacontenttype +dataschema +datatracker +dbe +de +deterministically +dev +df +ece +emmitted +english +enum +eventdata +fas +fc +fd +featureBranch +frittoli +geo +github +githubusercontent +gmail +golang +href +html +http +https +iaas +ietf +img +interoperable +io +jenkins +json +jsonschemas +keptn +knative +lcyAqZXZlbnQgdHlwZXMqLCB +lifecycle +linkTitle +markdownlint +md +metricA +minLength +modelled +myApp +myChange +myPipeline +mySubject +myTask +myTestCaseRun +myTestSuiteRun +myapp +mycluster +mycr +mydata +mygit +myorg +myvalue +nWith +namespace +namespaceB +namespaces +nist +nnnn +notational +observability +oci +oneOf +outputType +param +pdf +pipelineName +pipelineRun +pipelinerun +png +pre +py +quicktime +repo +reportedBy +responseTime +rfc +rolledback +rst +runtime +schemas +scp +sdk +sha +sig +sigs +somewherelse +specversion +src +subjectid +svg +taskName +taskRun +taskrun +taskruns +teamX +tekton +testCase +testCaseRun +testCaseRuns +testEnv +testOutput +testSuite +testSuiteRun +testSuiteRuns +testSuiteXXX +testcase +testcaserun +testkube +testoutput +testrunreport +testsuite +testsuiterun +ticketURI +tmeid +tmsrc +toc +typesystem +unitest +uri +url +userId +utf +viewUrl +whl +wikipedia +wpaper +www +xTENCM +xml +ypDXWCjlNKfzTV +yshmiPmp +znnSMNkQIhAJ diff --git a/.spellcheck.yml b/.spellcheck.yml new file mode 100644 index 00000000..e9c18a70 --- /dev/null +++ b/.spellcheck.yml @@ -0,0 +1,11 @@ +matrix: +- name: all + aspell: + lang: en + d: en_US + sources: + - "**/*.md" + - "**/*.json|!.github" + dictionary: + wordlists: + - .spellcheck-en-custom.txt diff --git a/core.md b/core.md index 33be5a5f..ad0d86f2 100644 --- a/core.md +++ b/core.md @@ -38,7 +38,7 @@ track the build and release progress on a particular software artifact. | pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | | outcome | `String` | outcome of a finished `pipelineRun` | `success`, `error` or `failure`| | url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` | -| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun cancelled by user`, `Unit tests failed`| +| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`| ### `taskRun` @@ -58,7 +58,7 @@ associated, in which case it is acceptable to generate only taskRun events. | pipelineRun | `Object` ([`pipelineRun`](#pipelinerun)) | The `pipelineRun` that this `taskRun` belongs to. | `{"id": "namespace/pipelinerun-1234"}`| | outcome | `String` | outcome of a finished `taskRun` | `success`, `error` or `failure`| | url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | -| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun cancelled by user`, `Unit tests failed`| +| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| ## Events @@ -112,7 +112,7 @@ A pipelineRun has finished, successfully or not. | pipelineName | `String` | The name of the pipeline | `MyPipeline`, `Unit tests for my repo` | | | url | `URI` | url to the `pipelineRun` | `https://dashboard.org/namespace/pipelinerun-1234`, `https://api.cdsystem.com/namespace/pipelinerun-1234` | | | outcome | `String (enum)` | outcome of a finished `pipelineRun` | `success`, `error` or `failure`| | -| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun cancelled by user`, `Unit tests failed`| | +| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `pipelineRun canceled by user`, `Unit tests failed`| | ### [`taskRun Started`](examples/taskrun_started.json) @@ -148,4 +148,4 @@ A taskRun has finished, successfully or not. | pipelineRun | `Object` ([`pipelineRun`](#pipelinerun)) | The `pipelineRun` that this `taskRun` belongs to. | `{"id": "namespace/pipelinerun-1234"}`| | | url | `URI` | url to the `taskRun` | `https://dashboard.org/namespace/taskrun-1234`, `https://api.cdsystem.com/namespace/taskrun-1234` | | | outcome | `String (enum)` | outcome of a finished `taskRun` | `success`, `error` or `failure`| | -| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun cancelled by user`, `Unit tests failed`| | +| errors | `String` | In case of error or failed pipeline, provides details about the failure | `Invalid input param 123`, `Timeout during execution`, `taskRun canceled by user`, `Unit tests failed`| | diff --git a/spec.md b/spec.md index 0c748c4e..61698d9d 100644 --- a/spec.md +++ b/spec.md @@ -82,6 +82,11 @@ The specification is structured in two main parts: For an introduction see the [CDEvents README](README.md) and for more background information please see our [CDEvents primer](https://cdevents.dev/docs/primer/). +## Spelling + +CDEvents adopt american english ("en_US") as dictionary for spelling both in the +specification as well as in the documentation. + ## Notations and Terminology ### Notational Conventions diff --git a/testing-events.md b/testing-events.md index 0bb2c62b..00661908 100644 --- a/testing-events.md +++ b/testing-events.md @@ -115,7 +115,7 @@ This event represents a finished testCase execution. The event will contain the | testSuiteRun | `Object` [`testSuiteRun`](#testsuiterun) | A testSuiteRun to associate this testCaseRun with a containing testSuiteRun | `{"id":"Auth-TestSuite-execution-12334", "source": "staging/testkube"}` | | | outcome | `String (enum)` | The outcome of the testSuite execution, one of `pass`, `fail`, `cancel`, `error` | `pass` | ✅ | | severity | `String (enum)` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical` | -| reason | `String` | A reason related to the outcome of the execution | `Cancelled by user`, `Failed assertion`, `Timed out` | | +| reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed assertion`, `Timed out` | | ### [`testSuiteRun queued`](examples/testsuiterun_queued.json) @@ -165,7 +165,7 @@ This event represents a finished testSuite execution. The event will contain the | environment | `Object` [`environment`](continuous-deployment.md/#environment) | The environment in which this testSuiteRun was running | `{"id": "1234"}`, `{"id": "dev", "source": "testkube-dev-123"}` | ✅ | | outcome | `String (enum)` | The outcome of the testSuite execution, one of `pass`, `fail`, `cancel`, `error` | `fail` | ✅ | | severity | `String (enum)` | Severity if the test failed, one of `low`, `medium`, `high`, `critical` | `critical`, `low`, `medium`, `high` | -| reason | `String` | A reason related to the outcome of the execution | `Cancelled by user`, `Failed testCase` | | +| reason | `String` | A reason related to the outcome of the execution | `Canceled by user`, `Failed testCase` | | | testSuite | `Object` [`testSuite`](#testsuite) | Definition of the testSuite being executed | `{"id": "92834723894", "name": "Auth TestSuite"}` | | ### [`testOutput published`](examples/testoutput_published.json) From 2ed9e297918a81e41e4ba72df2834070b18b85fe Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Fri, 12 Jan 2024 12:45:39 +0000 Subject: [PATCH 2/2] Refine the spelling configurartion Split spelling check of json and markdown files. For markdown add a context filter to ignore code blocks (inline and multiline). Enable url and camel case modes. Change the action to a different one, based on the same technology (pyspelling + aspell) as the current one does not support the came case mode. Signed-off-by: Andrea Frittoli --- .github/workflows/main.yml | 7 +- .spellcheck-en-custom.txt | 141 ------------------------------------- .spellcheck.yml | 30 +++++++- 3 files changed, 32 insertions(+), 146 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 224b15fc..1fe4058d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,7 @@ jobs: name: Spellcheck (en_US) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: igsekor/pyspelling-any@v0.0.2 - name: Spellcheck \ No newline at end of file + - name: Checkout Code + uses: actions/checkout@v3 + - name: Spellcheck + uses: rojopolis/spellcheck-github-actions@0.35.0 diff --git a/.spellcheck-en-custom.txt b/.spellcheck-en-custom.txt index 2111a88c..cca0d6ca 100644 --- a/.spellcheck-en-custom.txt +++ b/.spellcheck-en-custom.txt @@ -1,215 +1,82 @@ Auth BD -CDEvent -CDEvents CDF CVE -CamelCase -CloudEvent -CloudEvents -Enum -FHbGphQ -FidWxhcnkgZGVmaW Gerrit Github Gitlab JSON -JXRmtaU -JoY KH KyjITcZXHotdMB MEYCIQCBT -MergeRequest -MnY -MyPipeline NGua NIST -NZSh Notational -PGRhdGE -PullRequest -QXFaWFpsYm README -RIbHdaWE -RZ -RhdGE SCM -SDKs SIG -SKZ SRE -Schemas Tekton -TestOrg TestRepo -TestSuite URI UUID -VGhlIHZvY -VZ -ViamVjdHMqCg -VkdobElIWnZZMkZpZFd -Whitepaper -WmlBcWMzVmlhbVZqZEhNcUNnPT XiQlc -ZtYVc -aGNua -aGljaCBhcmUgbWFkZSBvZiAqc -aWhyZjVwb -aa -abc -abcde -aca -additionalProperties -aed american -anUyNDRvazdkdWpfMjAyMjAyMjJUMTYwMDAwWiBhbmRyZWEuZnJpdHRvbGlAbQ -andrea -api -apis -artifactId -bGN -bd -bml br -cSpell cardpane -cb -cbdf -ccb -cd -cdeliveryfdn cdevent cdevents -cdfoundation -cdsystem ce charset -ci cloudevents -clusterA -contentEncoding contenttype -csrc -customData -customDataContentType -customDataEncoding customdata customdatacontenttype -daR -daemonset datacontenttype dataschema -datatracker -dbe -de deterministically dev -df -ece emmitted english enum eventdata fas fc -fd -featureBranch -frittoli geo -github -githubusercontent -gmail -golang href -html http -https iaas -ietf img interoperable -io jenkins json -jsonschemas -keptn -knative -lcyAqZXZlbnQgdHlwZXMqLCB lifecycle -linkTitle markdownlint md -metricA -minLength modelled -myApp -myChange -myPipeline -mySubject -myTask -myTestCaseRun -myTestSuiteRun -myapp -mycluster -mycr mydata -mygit -myorg myvalue -nWith namespace namespaceB -namespaces -nist nnnn notational observability -oci -oneOf -outputType param pdf -pipelineName -pipelineRun pipelinerun png pre -py quicktime -repo -reportedBy -responseTime rfc rolledback -rst runtime -schemas -scp -sdk -sha -sig -sigs somewherelse specversion src subjectid -svg -taskName -taskRun taskrun -taskruns -teamX tekton -testCase -testCaseRun -testCaseRuns testEnv -testOutput -testSuite -testSuiteRun -testSuiteRuns -testSuiteXXX testcase testcaserun testkube @@ -218,21 +85,13 @@ testrunreport testsuite testsuiterun ticketURI -tmeid -tmsrc toc typesystem -unitest uri url -userId utf viewUrl -whl -wikipedia wpaper -www -xTENCM xml ypDXWCjlNKfzTV yshmiPmp diff --git a/.spellcheck.yml b/.spellcheck.yml index e9c18a70..cd5a3568 100644 --- a/.spellcheck.yml +++ b/.spellcheck.yml @@ -1,11 +1,37 @@ matrix: -- name: all +- name: json aspell: lang: en d: en_US + camel-case: true + mode: url sources: - - "**/*.md" - "**/*.json|!.github" dictionary: wordlists: - .spellcheck-en-custom.txt +- name: markdown + aspell: + lang: en + d: en_US + camel-case: true + mode: url + sources: + - "**/*.md" + dictionary: + wordlists: + - .spellcheck-en-custom.txt + pipeline: + - pyspelling.filters.context: + context_visible_first: true + escapes: '\\[\\`~]' + delimiters: + # Ignore multiline content between fences (fences can have 3 or more back ticks) + # ``` + # content + # ``` + - open: '(?s)^(?P *`{3,})$' + close: '^(?P=open)$' + # Ignore text between inline back ticks + - open: '(?P`+)' + close: '(?P=open)' \ No newline at end of file