From d6ac9f258cc4ff604991c77ab459e46182b67f66 Mon Sep 17 00:00:00 2001 From: Enno Runne <458526+ennru@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:35:55 +0200 Subject: [PATCH] chore: add linting in CI (#475) * chore: add linting in CI * fix some spelling * Fix some more * Fix spelling and vocabulary errors in samples dir (#476) Exclude vocab text files from license check. --------- Co-authored-by: Brent Eritou --- .github/workflows/linting.yml | 29 + .vale.ini | 21 + build/license.json | 1 + .../pages/actions-publishing-subscribing.adoc | 4 +- .../pages/call-another-service.adoc | 8 +- .../javascript/pages/developer-tools.adoc | 2 +- docs/src/modules/javascript/pages/index.adoc | 4 +- .../sc-eventsourced-entity-javascript.adoc | 2 +- .../sc-eventsourced-entity-typescript.adoc | 2 +- .../javascript/pages/serialization.adoc | 2 +- .../javascript/pages/value-entity.adoc | 8 +- .../src/modules/javascript/partials/json.adoc | 4 +- .../partials/topic-eventing-cloudevent.adoc | 2 +- .../ts-eventsourced-shopping-cart/README.md | 2 +- samples/ts/ts-valueentity-counter/README.md | 2 +- styles/Lightbend/AMPM.yml | 9 + styles/Lightbend/Accessibility.yml | 25 + styles/Lightbend/Acronyms.yml | 65 ++ styles/Lightbend/Adverbs.yml | 270 +++++++ styles/Lightbend/Auto.yml | 11 + styles/Lightbend/Avoid.yml | 14 + styles/Lightbend/ComplexWords.yml | 120 +++ styles/Lightbend/Contractions.yml | 30 + styles/Lightbend/Dashes.yml | 13 + styles/Lightbend/DateFormat.yml | 8 + styles/Lightbend/DateNumbers.yml | 40 + styles/Lightbend/DateOrder.yml | 8 + styles/Lightbend/Ellipses.yml | 9 + styles/Lightbend/FirstPerson.yml | 16 + styles/Lightbend/Foreign.yml | 12 + styles/Lightbend/Gender.yml | 8 + styles/Lightbend/GenderBias.yml | 44 ++ styles/Lightbend/GeneralURL.yml | 11 + styles/Lightbend/HeadingAcronyms.yml | 7 + styles/Lightbend/HeadingColons.yml | 8 + styles/Lightbend/HeadingPunctuation.yml | 13 + styles/Lightbend/Headings.yml | 28 + styles/Lightbend/Hyphens.yml | 14 + styles/Lightbend/Ordinal.yml | 13 + styles/Lightbend/OxfordComma.yml | 8 + styles/Lightbend/Passive.yml | 183 +++++ styles/Lightbend/Percentages.yml | 7 + styles/Lightbend/Quotes.yml | 7 + styles/Lightbend/RangeFormat.yml | 13 + styles/Lightbend/RangeTime.yml | 13 + styles/Lightbend/Ranges.yml | 7 + styles/Lightbend/Readability.yml | 11 + styles/Lightbend/Semicolon.yml | 8 + styles/Lightbend/SentenceLength.yml | 7 + styles/Lightbend/Spacing.yml | 7 + styles/Lightbend/Suspended.yml | 7 + styles/Lightbend/Terms.yml | 43 ++ styles/Lightbend/URLFormat.yml | 10 + styles/Lightbend/Units.yml | 16 + styles/Lightbend/Vocab.yml | 25 + styles/Lightbend/We.yml | 11 + styles/Lightbend/Wordiness.yml | 122 +++ styles/Lightbend/meta.json | 4 + styles/Microsoft/AMPM.yml | 9 + styles/Microsoft/Accessibility.yml | 25 + styles/Microsoft/Acronyms.yml | 64 ++ styles/Microsoft/Adverbs.yml | 270 +++++++ styles/Microsoft/Auto.yml | 11 + styles/Microsoft/Avoid.yml | 14 + styles/Microsoft/ComplexWords.yml | 120 +++ styles/Microsoft/Contractions.yml | 50 ++ styles/Microsoft/Dashes.yml | 13 + styles/Microsoft/DateFormat.yml | 8 + styles/Microsoft/DateNumbers.yml | 40 + styles/Microsoft/DateOrder.yml | 8 + styles/Microsoft/Ellipses.yml | 9 + styles/Microsoft/FirstPerson.yml | 16 + styles/Microsoft/Foreign.yml | 12 + styles/Microsoft/Gender.yml | 8 + styles/Microsoft/GenderBias.yml | 44 ++ styles/Microsoft/GeneralURL.yml | 11 + styles/Microsoft/HeadingAcronyms.yml | 7 + styles/Microsoft/HeadingColons.yml | 8 + styles/Microsoft/HeadingPunctuation.yml | 13 + styles/Microsoft/Headings.yml | 28 + styles/Microsoft/Hyphens.yml | 14 + styles/Microsoft/Negative.yml | 13 + styles/Microsoft/Ordinal.yml | 13 + styles/Microsoft/OxfordComma.yml | 8 + styles/Microsoft/Passive.yml | 183 +++++ styles/Microsoft/Percentages.yml | 7 + styles/Microsoft/Quotes.yml | 7 + styles/Microsoft/RangeFormat.yml | 13 + styles/Microsoft/RangeTime.yml | 13 + styles/Microsoft/Ranges.yml | 7 + styles/Microsoft/Semicolon.yml | 8 + styles/Microsoft/SentenceLength.yml | 7 + styles/Microsoft/Spacing.yml | 8 + styles/Microsoft/Suspended.yml | 7 + styles/Microsoft/Terms.yml | 43 ++ styles/Microsoft/URLFormat.yml | 10 + styles/Microsoft/Units.yml | 16 + styles/Microsoft/Vocab.yml | 25 + styles/Microsoft/We.yml | 11 + styles/Microsoft/Wordiness.yml | 122 +++ styles/Microsoft/meta.json | 4 + styles/Vocab/Base/accept.txt | 101 +++ styles/Vocab/Base/reject.txt | 0 styles/write-good/Cliches.yml | 702 ++++++++++++++++++ styles/write-good/E-Prime.yml | 32 + styles/write-good/Illusions.yml | 11 + styles/write-good/Passive.yml | 183 +++++ styles/write-good/README.md | 27 + styles/write-good/So.yml | 5 + styles/write-good/ThereIs.yml | 6 + styles/write-good/TooWordy.yml | 221 ++++++ styles/write-good/Weasel.yml | 207 ++++++ styles/write-good/meta.json | 4 + 113 files changed, 4203 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/linting.yml create mode 100644 .vale.ini create mode 100644 styles/Lightbend/AMPM.yml create mode 100644 styles/Lightbend/Accessibility.yml create mode 100644 styles/Lightbend/Acronyms.yml create mode 100644 styles/Lightbend/Adverbs.yml create mode 100644 styles/Lightbend/Auto.yml create mode 100644 styles/Lightbend/Avoid.yml create mode 100644 styles/Lightbend/ComplexWords.yml create mode 100644 styles/Lightbend/Contractions.yml create mode 100644 styles/Lightbend/Dashes.yml create mode 100644 styles/Lightbend/DateFormat.yml create mode 100644 styles/Lightbend/DateNumbers.yml create mode 100644 styles/Lightbend/DateOrder.yml create mode 100644 styles/Lightbend/Ellipses.yml create mode 100644 styles/Lightbend/FirstPerson.yml create mode 100644 styles/Lightbend/Foreign.yml create mode 100644 styles/Lightbend/Gender.yml create mode 100644 styles/Lightbend/GenderBias.yml create mode 100644 styles/Lightbend/GeneralURL.yml create mode 100644 styles/Lightbend/HeadingAcronyms.yml create mode 100644 styles/Lightbend/HeadingColons.yml create mode 100644 styles/Lightbend/HeadingPunctuation.yml create mode 100644 styles/Lightbend/Headings.yml create mode 100644 styles/Lightbend/Hyphens.yml create mode 100644 styles/Lightbend/Ordinal.yml create mode 100644 styles/Lightbend/OxfordComma.yml create mode 100644 styles/Lightbend/Passive.yml create mode 100644 styles/Lightbend/Percentages.yml create mode 100644 styles/Lightbend/Quotes.yml create mode 100644 styles/Lightbend/RangeFormat.yml create mode 100644 styles/Lightbend/RangeTime.yml create mode 100644 styles/Lightbend/Ranges.yml create mode 100644 styles/Lightbend/Readability.yml create mode 100644 styles/Lightbend/Semicolon.yml create mode 100644 styles/Lightbend/SentenceLength.yml create mode 100644 styles/Lightbend/Spacing.yml create mode 100644 styles/Lightbend/Suspended.yml create mode 100644 styles/Lightbend/Terms.yml create mode 100644 styles/Lightbend/URLFormat.yml create mode 100644 styles/Lightbend/Units.yml create mode 100644 styles/Lightbend/Vocab.yml create mode 100644 styles/Lightbend/We.yml create mode 100644 styles/Lightbend/Wordiness.yml create mode 100644 styles/Lightbend/meta.json create mode 100644 styles/Microsoft/AMPM.yml create mode 100644 styles/Microsoft/Accessibility.yml create mode 100644 styles/Microsoft/Acronyms.yml create mode 100644 styles/Microsoft/Adverbs.yml create mode 100644 styles/Microsoft/Auto.yml create mode 100644 styles/Microsoft/Avoid.yml create mode 100644 styles/Microsoft/ComplexWords.yml create mode 100644 styles/Microsoft/Contractions.yml create mode 100644 styles/Microsoft/Dashes.yml create mode 100644 styles/Microsoft/DateFormat.yml create mode 100644 styles/Microsoft/DateNumbers.yml create mode 100644 styles/Microsoft/DateOrder.yml create mode 100644 styles/Microsoft/Ellipses.yml create mode 100644 styles/Microsoft/FirstPerson.yml create mode 100644 styles/Microsoft/Foreign.yml create mode 100644 styles/Microsoft/Gender.yml create mode 100644 styles/Microsoft/GenderBias.yml create mode 100644 styles/Microsoft/GeneralURL.yml create mode 100644 styles/Microsoft/HeadingAcronyms.yml create mode 100644 styles/Microsoft/HeadingColons.yml create mode 100644 styles/Microsoft/HeadingPunctuation.yml create mode 100644 styles/Microsoft/Headings.yml create mode 100644 styles/Microsoft/Hyphens.yml create mode 100644 styles/Microsoft/Negative.yml create mode 100644 styles/Microsoft/Ordinal.yml create mode 100644 styles/Microsoft/OxfordComma.yml create mode 100644 styles/Microsoft/Passive.yml create mode 100644 styles/Microsoft/Percentages.yml create mode 100644 styles/Microsoft/Quotes.yml create mode 100644 styles/Microsoft/RangeFormat.yml create mode 100644 styles/Microsoft/RangeTime.yml create mode 100644 styles/Microsoft/Ranges.yml create mode 100644 styles/Microsoft/Semicolon.yml create mode 100644 styles/Microsoft/SentenceLength.yml create mode 100644 styles/Microsoft/Spacing.yml create mode 100644 styles/Microsoft/Suspended.yml create mode 100644 styles/Microsoft/Terms.yml create mode 100644 styles/Microsoft/URLFormat.yml create mode 100644 styles/Microsoft/Units.yml create mode 100644 styles/Microsoft/Vocab.yml create mode 100644 styles/Microsoft/We.yml create mode 100644 styles/Microsoft/Wordiness.yml create mode 100644 styles/Microsoft/meta.json create mode 100644 styles/Vocab/Base/accept.txt create mode 100644 styles/Vocab/Base/reject.txt create mode 100644 styles/write-good/Cliches.yml create mode 100644 styles/write-good/E-Prime.yml create mode 100644 styles/write-good/Illusions.yml create mode 100644 styles/write-good/Passive.yml create mode 100644 styles/write-good/README.md create mode 100644 styles/write-good/So.yml create mode 100644 styles/write-good/ThereIs.yml create mode 100644 styles/write-good/TooWordy.yml create mode 100644 styles/write-good/Weasel.yml create mode 100644 styles/write-good/meta.json diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 00000000..4afd0dd0 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,29 @@ +name: Linting + +on: + pull_request: + push: + branches: + - main + tags-ignore: [ v.* ] + +jobs: + prose: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + # https://github.com/actions/checkout/releases + # v3.5.0 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 + + # https://vale.sh + - name: Vale + # https://github.com/errata-ai/vale-action/releases + # v2.0.1 + uses: errata-ai/vale-action@c4213d4de3d5f718b8497bd86161531c78992084 + with: + files: '["docs/dev", "docs/src", "samples"]' + fail_on_error: true + filter_mode: nofilter + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 00000000..8bc11d6f --- /dev/null +++ b/.vale.ini @@ -0,0 +1,21 @@ +StylesPath = styles + +MinAlertLevel = error +Vocab = Base + +Packages = Microsoft, write-good + +[*.{md,adoc}] +BasedOnStyles = Vale, Lightbend, write-good + +# Override the alert level of certain styles +Vale.Repetition = warning +Lightbend.Contractions = suggestion +Lightbend.Avoid = warning +write-good.So = suggestion +write-good.ThereIs = suggestion +Lightbend.Foreign = warning +Lightbend.HeadingColons = warning +Lightbend.RangeFormat = suggestion +Lightbend.URLFormat = suggestion +Lightbend.Auto = warning diff --git a/build/license.json b/build/license.json index aeb53f70..f3c94549 100644 --- a/build/license.json +++ b/build/license.json @@ -12,6 +12,7 @@ "**/*.yml", "samples/*/*/lib/generated", "sdk/test/*.desc", + "styles/Vocab/Base/", "tck/generated", "testkit/integration-test/proto.*" ], diff --git a/docs/src/modules/javascript/pages/actions-publishing-subscribing.adoc b/docs/src/modules/javascript/pages/actions-publishing-subscribing.adoc index 0fbeabd3..b7a0ab53 100644 --- a/docs/src/modules/javascript/pages/actions-publishing-subscribing.adoc +++ b/docs/src/modules/javascript/pages/actions-publishing-subscribing.adoc @@ -25,7 +25,7 @@ To achieve this, create an xref:actions.adoc[Action] that subscribes to a journa .Use case: external calls **** -A service might need to trigger other systems when certain events happened to an Entity. An Action can be connected to the Entity's journal and react on certain events to issue calls (eg. via HTTP or gRPC). +A service might need to trigger other systems when certain events happened to an Entity. An Action can be connected to the Entity's journal and react on certain events to issue calls (e.g. via HTTP or gRPC). To achieve this, create an xref:actions.adoc[Action] that subscribes to a journal and let the implementation call other services. **** @@ -56,7 +56,7 @@ include::example$eventing-shopping-cart/proto/cart/shopping_cart_analytics.proto <1> annotate the Protobuf rpc method with `(kalix.method).eventing` <2> use `in` and `topic` to subscribe to a topic -There is nothing specific required in the implementation of `ProcessAdded`. The implementation will in most cases be an Action and forward a converted message to a different component (eg. an Event Sourced Entity). +There is nothing specific required in the implementation of `ProcessAdded`. The implementation will in most cases be an Action and forward a converted message to a different component (e.g. an Event Sourced Entity). == Receiving messages from an external Topic diff --git a/docs/src/modules/javascript/pages/call-another-service.adoc b/docs/src/modules/javascript/pages/call-another-service.adoc index d79c1bdb..2ef29ed9 100644 --- a/docs/src/modules/javascript/pages/call-another-service.adoc +++ b/docs/src/modules/javascript/pages/call-another-service.adoc @@ -6,7 +6,7 @@ In some cases it is useful to call a component in another service, for example i Calling other Kalix services in the same project from an Action is done by invoking them over gRPC much like how an external client would. The service is however identified only by the name it has been deployed as, Kalix takes care of routing requests to the service and keeping the data safe by encrypting the connection for us. -In this sample we will show an action that does two sequential calls to the xref:value-entity.adoc[Value Entity Counter] service, deployed with the service name "counter". +In this sample we will show an action that does two sequential calls to the xref:value-entity.adoc[Value Entity Counter] service, deployed with the service name "counter." We start by adding the public API of the counter to the `src/main/proto` directory of our project. @@ -33,7 +33,7 @@ In our delegating service implementation: include::example$js-doc-snippets/src/delegatingservice.js[tag=delegating-action] ---- <1> Include the `proto` file of the other service in the action service descriptors. -<2> Create the client using the provided creators to get async methods. Defaults to a cleartext connection as TLS is handled transparently for us. +<2> Create the client using the provided creators to get async methods. Defaults to a clear text connection as TLS is handled transparently for us. <3> Use the name that the other Kalix service was deployed as, in this case `counter`. <4> We can now call the various methods on the other service with their method names directly on the client. The calls return promises so we can use `await/async` to interact with them. @@ -41,7 +41,7 @@ NOTE: The client can only be created once the service has been started by Kalix, == External gRPC services -Calling a Kalix service in another project, or an arbitrary external gRPC service is done the same way as described above, with the difference that it will use the full public hostname of the service and TLS/HTTPS to encrypt the connection. +Calling a Kalix service in another project, or an arbitrary external gRPC service is done the same way as described above, with the difference that it will use the full public hostname of the service and TLS/https to encrypt the connection. [source,javascript,indent=0] .src/main/java/com/example/delegatingservice.js @@ -51,4 +51,4 @@ include::example$js-doc-snippets/src/delegatingservice.js[tag=public-grpc] <1> Import `grpc-js`, to provide credentials when creating the client. <2> Create the client using the provided creators to get async methods. <3> Use the full public hostname of the service. -<4> Enable TLS/HTTPS to encrypt the connection. +<4> Enable TLS/https to encrypt the connection. diff --git a/docs/src/modules/javascript/pages/developer-tools.adoc b/docs/src/modules/javascript/pages/developer-tools.adoc index ed2e9edd..d160f727 100644 --- a/docs/src/modules/javascript/pages/developer-tools.adoc +++ b/docs/src/modules/javascript/pages/developer-tools.adoc @@ -1,6 +1,6 @@ = Developer Tools -The Javascript tooling is published to the npm registry under the https://www.npmjs.com/org/kalix-io[`@kalix-io` organisation]. +The JavaScript tooling is published to the npm registry under the https://www.npmjs.com/org/kalix-io[`@kalix-io` organisation]. == Kickstart diff --git a/docs/src/modules/javascript/pages/index.adoc b/docs/src/modules/javascript/pages/index.adoc index 10e45995..8ee69771 100644 --- a/docs/src/modules/javascript/pages/index.adoc +++ b/docs/src/modules/javascript/pages/index.adoc @@ -69,9 +69,9 @@ The following shows a minimal `package.json` configuration for a shopping cart s Descriptors for gRPC are defined in `protobuf` files. You can place `protobuf` files in your project wherever you like, for example, in the root directory, or in a directory named `protos`. In the `package.json` example, above we've placed the service descriptor in a file in the root folder called `shoppingcart.proto`. See xref:proto.adoc[] for more details. -=== Precompile the protobuf descriptor set +=== Pre-compile the protobuf descriptor set -The gRPC descriptor is serialized to binary using the Protobuf https://developers.google.com/protocol-buffers/docs/techniques#self-description[`FileDescriptorSet` message type]. Kalix requires that you precompile this descriptor using `protoc`. We provide a utility that does this for you. It downloads the `protoc` binary for your platform, and runs it with the necessary arguments and include paths. You can run the utility manually, or we recommend adding it as a script to the build. +The gRPC descriptor is serialized to binary using the Protobuf https://developers.google.com/protocol-buffers/docs/techniques#self-description[`FileDescriptorSet` message type]. Kalix requires that you pre-compile this descriptor using `protoc`. We provide a utility that does this for you. It downloads the `protoc` binary for your platform, and runs it with the necessary arguments and include paths. You can run the utility manually, or we recommend adding it as a script to the build. To run the utility manually, invoke `node_modules/@kalix-io/kalix-javascript-sdk/bin/compile-descriptor.js`. diff --git a/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-javascript.adoc b/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-javascript.adoc index bf367715..daffa85a 100644 --- a/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-javascript.adoc +++ b/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-javascript.adoc @@ -194,7 +194,7 @@ include::javascript:example$js-shopping-cart-quickstart/src/shoppingcart.js[tag= + -- * This function takes the current internal state and converts it to the external API model. -* The conversion between the domain and the external API is straigtforward, as they have the same fields. +* The conversion between the domain and the external API is straightforward, as they have the same fields. -- + [source, javascript, indent=0] diff --git a/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-typescript.adoc b/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-typescript.adoc index da1bb0d3..0a07cba5 100644 --- a/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-typescript.adoc +++ b/docs/src/modules/javascript/pages/quickstart/sc-eventsourced-entity-typescript.adoc @@ -202,7 +202,7 @@ include::javascript:example$ts-shopping-cart-quickstart/src/shoppingcart.ts[tag= + -- * This function takes the current internal state and converts it to the external API model. -* The conversion between the domain and the external API is straigtforward, as they have the same fields. +* The conversion between the domain and the external API is straightforward, as they have the same fields. -- + [source, typescript, indent=0] diff --git a/docs/src/modules/javascript/pages/serialization.adoc b/docs/src/modules/javascript/pages/serialization.adoc index 876fa4bc..dd8261c2 100644 --- a/docs/src/modules/javascript/pages/serialization.adoc +++ b/docs/src/modules/javascript/pages/serialization.adoc @@ -4,7 +4,7 @@ include::ROOT:partial$include.adoc[] include::partial$serialization.adoc[] -As a JavaScript developer, JSON is likely more familiar to you. When creating Event Sourced Entities, you can configure serialization for primitives or for Json, using `serializeAllowPrimitives` or `serializeFallbacktoJson`, respectively. +As a JavaScript developer, JSON is likely more familiar to you. When creating Event Sourced Entities, you can configure serialization for primitives or for JSON, using `serializeAllowPrimitives` or `serializeFallbacktoJson`, respectively. == Setting the serialization flag diff --git a/docs/src/modules/javascript/pages/value-entity.adoc b/docs/src/modules/javascript/pages/value-entity.adoc index dfc86a2d..e00945f3 100644 --- a/docs/src/modules/javascript/pages/value-entity.adoc +++ b/docs/src/modules/javascript/pages/value-entity.adoc @@ -27,7 +27,7 @@ The following `counter_domain.proto` file defines a "Counter" Value Entity. The include::example$valueentity-counter/proto/counter_domain.proto[] ---- -<1> Any classes generated from this protobuf file will be nested in the package heirarchy of: `com.example.domain`. +<1> Any classes generated from this protobuf file will be nested in the package hierarchy of: `com.example.domain`. <2> The `CounterState` protobuf message is what Kalix stores for this entity. The `counter_api.proto` file defines the commands we can send to the Counter service to manipulate or access the Counter`s state. They make up the service API: @@ -37,7 +37,7 @@ The `counter_api.proto` file defines the commands we can send to the Counter ser include::example$valueentity-counter/proto/counter_api.proto[] ---- <1> Import the Kalix protobuf annotations, or options. -<2> Any classes generated from this protobuf file will be be nested in the package heirarchy: `com.example`. +<2> Any classes generated from this protobuf file will be be nested in the package hierarchy: `com.example`. <3> Protobuf messages describe the Commands that the service handles. They may contain other messages to represent structured data. <4> Every Command must contain a `string` field that contains the entity ID and is marked with the `(kalix.field).entity_key` option. @@ -45,7 +45,7 @@ include::example$valueentity-counter/proto/counter_api.proto[] <6> The service descriptor shows the API of the entity. It lists the methods a client can use to issue Commands to the entity. <7> The protobuf option `(kalix.codegen).value_entity` is specific to code-generation as provided by the Kalix plugin. <8> `name` denotes the base name for the Value entity, the code-generation will create initial sources `CounterImpl`, `CounterTest` and `CounterIntegrationTest`. Once these files exist, they are not overwritten, so you can freely add logic to them. -<9> `entity_type` is a unique identifier of the "state storage". The entity name may be changed even after data has been created, the `entity_type` can't. This value shows in the `@ValueEnity` annotation of your entity implementation. +<9> `entity_type` is a unique identifier of the "state storage." The entity name may be changed even after data has been created, the `entity_type` can't. This value shows in the `@ValueEnity` annotation of your entity implementation. <10> `state` points to the protobuf message representing the Value entity's state which is kept by Kalix == Creating an Entity @@ -74,7 +74,7 @@ include::example$ts-valueentity-counter/src/counter.ts[tag=entity-class] == Using protobuf types -When passing state to Kalix the persisted data must be serialized and accessable. To request state types, lookup the protobuf type then use the `create` method. +When passing state to Kalix the persisted data must be serialized and accessible. To request state types, lookup the protobuf type then use the `create` method. Use the `ValueEntity` link:{attachmentsdir}/api/classes/ValueEntity.html#lookupType[`lookupType`{tab-icon}, window="new"] helper to look up these types so we can use them later. diff --git a/docs/src/modules/javascript/partials/json.adoc b/docs/src/modules/javascript/partials/json.adoc index 23705f76..e0887e73 100644 --- a/docs/src/modules/javascript/partials/json.adoc +++ b/docs/src/modules/javascript/partials/json.adoc @@ -25,11 +25,11 @@ service ShoppingCartTopicService { == Publishing JSON messages to a topic -By default when publishig a message to a topic, the protobuf message is serialized to bytes and published with the `content-type`/`ce-datacontenttype` `application/protobuf`, and will also contain the metadata entry `ce-type` specifying the specific protobuf message type. +By default, when publishing a message to a topic, the protobuf message is serialized to bytes and published with the `content-type`/`ce-datacontenttype` `application/protobuf`, and will also contain the metadata entry `ce-type` specifying the specific protobuf message type. This is convenient when the consumer is another Kalix service that can handle protobuf messages. -In many cases the consumer may be an external service though, and in such a case another serialization format for the messages can make sense. For such a use case the Kalix Javascript SDK supports emitting JSON messages. +In many cases the consumer may be an external service though, and in such a case another serialization format for the messages can make sense. For such a use case the Kalix JavaScript SDK supports emitting JSON messages. To publish JSON messages to a topic, mark the return type of the message as `google.protobuf.Any`. The object returned with `replies.message()` will be serialized to string format and published to the topic with content type `Content-Type` attribute stating `application/json`. diff --git a/docs/src/modules/javascript/partials/topic-eventing-cloudevent.adoc b/docs/src/modules/javascript/partials/topic-eventing-cloudevent.adoc index 69f7fc81..549aee96 100644 --- a/docs/src/modules/javascript/partials/topic-eventing-cloudevent.adoc +++ b/docs/src/modules/javascript/partials/topic-eventing-cloudevent.adoc @@ -12,7 +12,7 @@ To allow proper reading of Protobuf messages from topics, the messages need to s - `Content-Type` = `application/protobuf` - `ce-specversion` = `1.0` -- `ce-type` = fully qualified protobuf message name (eg. `shopping.cart.api.TopicOperation`) +- `ce-type` = fully qualified protobuf message name (e.g. `shopping.cart.api.TopicOperation`) (The `ce-` prefixed attributes are part of the CloudEvents specification.) diff --git a/samples/ts/ts-eventsourced-shopping-cart/README.md b/samples/ts/ts-eventsourced-shopping-cart/README.md index 22d24a35..f4112a0d 100644 --- a/samples/ts/ts-eventsourced-shopping-cart/README.md +++ b/samples/ts/ts-eventsourced-shopping-cart/README.md @@ -96,5 +96,5 @@ You will need to update the `config.dockerImage` property in the `package.json` Finally, you can use the [Kalix Console](https://console.kalix.io) to create a project and then deploy your service into the project either by using `npm run deploy`, -through the `kalix` CLI or via the web interface. When using `npm run deploy`, NPM will also +through the `kalix` CLI or via the web interface. When using `npm run deploy`, npm will also conveniently package and publish your docker image prior to deployment. diff --git a/samples/ts/ts-valueentity-counter/README.md b/samples/ts/ts-valueentity-counter/README.md index bf689119..50eecc68 100644 --- a/samples/ts/ts-valueentity-counter/README.md +++ b/samples/ts/ts-valueentity-counter/README.md @@ -97,5 +97,5 @@ for more information on how to make your docker image available to Kalix. Finally you can or use the [Kalix Console](https://console.kalix.io) to create a project and then deploy your service into the project either by using `npm run deploy`, -through the `kalix` CLI or via the web interface. When using `npm run deploy`, NPM will also +through the `kalix` CLI or via the web interface. When using `npm run deploy`, npm will also conveniently package and publish your docker image prior to deployment. diff --git a/styles/Lightbend/AMPM.yml b/styles/Lightbend/AMPM.yml new file mode 100644 index 00000000..8b9fed16 --- /dev/null +++ b/styles/Lightbend/AMPM.yml @@ -0,0 +1,9 @@ +extends: existence +message: Use 'AM' or 'PM' (preceded by a space). +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms +level: error +nonword: true +tokens: + - '\d{1,2}[AP]M' + - '\d{1,2} ?[ap]m' + - '\d{1,2} ?[aApP]\.[mM]\.' diff --git a/styles/Lightbend/Accessibility.yml b/styles/Lightbend/Accessibility.yml new file mode 100644 index 00000000..05bf9273 --- /dev/null +++ b/styles/Lightbend/Accessibility.yml @@ -0,0 +1,25 @@ +extends: existence +message: "Don't use language (such as '%s') that defines people by their disability." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms +level: suggestion +ignorecase: true +tokens: + - a victim of + - able-bodied + - affected by + - an epileptic + - crippled + - disabled + - dumb + - handicapped + - handicaps + - healthy + - lame + - maimed + - missing a limb + - mute + - normal + - sight-impaired + - stricken with + - suffers from + - vision-impaired diff --git a/styles/Lightbend/Acronyms.yml b/styles/Lightbend/Acronyms.yml new file mode 100644 index 00000000..c3becfc1 --- /dev/null +++ b/styles/Lightbend/Acronyms.yml @@ -0,0 +1,65 @@ +extends: conditional +message: "'%s' has no definition." +link: https://docs.microsoft.com/en-us/style-guide/acronyms +level: suggestion +ignorecase: false +# Ensures that the existence of 'first' implies the existence of 'second'. +first: '\b([A-Z]{3,5})\b' +second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' +# ... with the exception of these: +exceptions: + - CA + - API + - ASP + - CLI + - CPU + - CSS + - CSV + - DEBUG + - DOM + - DPI + - FAQ + - GCC + - GDB + - GET + - GPU + - GTK + - GUI + - HTML + - HTTP + - HTTPS + - IDE + - JAR + - JSON + - JSX + - LESS + - LLDB + - NET + - NOTE + - NVDA + - OSS + - PATH + - PDF + - PHP + - POST + - RAM + - REPL + - RSA + - SCM + - SCSS + - SDK + - SQL + - SSH + - SSL + - SVG + - TBD + - TCP + - TODO + - URI + - URL + - USB + - UTF + - XML + - XSS + - YAML + - ZIP diff --git a/styles/Lightbend/Adverbs.yml b/styles/Lightbend/Adverbs.yml new file mode 100644 index 00000000..07d98d83 --- /dev/null +++ b/styles/Lightbend/Adverbs.yml @@ -0,0 +1,270 @@ +extends: existence +message: "Consider removing '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: warning +action: + name: remove +tokens: + - abnormally + - absentmindedly + - accidentally + - adventurously + - anxiously + - arrogantly + - awkwardly + - bashfully + - beautifully + - bitterly + - bleakly + - blindly + - blissfully + - boastfully + - boldly + - bravely + - briefly + - brightly + - briskly + - broadly + - busily + - calmly + - carefully + - carelessly + - cautiously + - cheerfully + - cleverly + - closely + - coaxingly + - colorfully + - continually + - coolly + - courageously + - crossly + - cruelly + - curiously + - daintily + - dearly + - deceivingly + - deeply + - defiantly + - deliberately + - delightfully + - diligently + - dimly + - doubtfully + - dreamily + - easily + - elegantly + - energetically + - enormously + - enthusiastically + - excitedly + - extremely + - fairly + - faithfully + - famously + - ferociously + - fervently + - fiercely + - fondly + - foolishly + - fortunately + - frankly + - frantically + - freely + - frenetically + - frightfully + - furiously + - generally + - generously + - gently + - gladly + - gleefully + - gracefully + - gratefully + - greatly + - greedily + - happily + - hastily + - healthily + - heavily + - helplessly + - honestly + - hopelessly + - hungrily + - innocently + - inquisitively + - intensely + - intently + - interestingly + - inwardly + - irritably + - jaggedly + - jealously + - jovially + - joyfully + - joyously + - jubilantly + - judgmentally + - justly + - keenly + - kiddingly + - kindheartedly + - knavishly + - knowingly + - knowledgeably + - lazily + - lightly + - limply + - lively + - loftily + - longingly + - loosely + - loudly + - lovingly + - loyally + - madly + - majestically + - meaningfully + - mechanically + - merrily + - miserably + - mockingly + - mortally + - mysteriously + - naturally + - nearly + - neatly + - nervously + - nicely + - noisily + - obediently + - obnoxiously + - oddly + - offensively + - optimistically + - overconfidently + - painfully + - partially + - patiently + - perfectly + - playfully + - politely + - poorly + - positively + - potentially + - powerfully + - promptly + - properly + - punctually + - quaintly + - queasily + - queerly + - questionably + - quickly + - quietly + - quirkily + - quizzically + - randomly + - rapidly + - rarely + - readily + - really + - reassuringly + - recklessly + - regularly + - reluctantly + - repeatedly + - reproachfully + - restfully + - righteously + - rightfully + - rigidly + - roughly + - rudely + - safely + - scarcely + - scarily + - searchingly + - sedately + - seemingly + - selfishly + - separately + - seriously + - shakily + - sharply + - sheepishly + - shrilly + - shyly + - silently + - sleepily + - slowly + - smoothly + - softly + - solemnly + - solidly + - speedily + - stealthily + - sternly + - strictly + - suddenly + - supposedly + - surprisingly + - suspiciously + - sweetly + - swiftly + - sympathetically + - tenderly + - tensely + - terribly + - thankfully + - thoroughly + - thoughtfully + - tightly + - tremendously + - triumphantly + - truthfully + - ultimately + - unabashedly + - unaccountably + - unbearably + - unethically + - unexpectedly + - unfortunately + - unimpressively + - unnaturally + - unnecessarily + - urgently + - usefully + - uselessly + - utterly + - vacantly + - vaguely + - vainly + - valiantly + - vastly + - verbally + - very + - viciously + - victoriously + - violently + - vivaciously + - voluntarily + - warmly + - weakly + - wearily + - wetly + - wholly + - wildly + - willfully + - wisely + - woefully + - wonderfully + - worriedly + - yawningly + - yearningly + - yieldingly + - youthfully + - zealously + - zestfully + - zestily diff --git a/styles/Lightbend/Auto.yml b/styles/Lightbend/Auto.yml new file mode 100644 index 00000000..4da43935 --- /dev/null +++ b/styles/Lightbend/Auto.yml @@ -0,0 +1,11 @@ +extends: existence +message: "In general, don't hyphenate '%s'." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/a/auto +ignorecase: true +level: error +action: + name: convert + params: + - simple +tokens: + - 'auto-\w+' diff --git a/styles/Lightbend/Avoid.yml b/styles/Lightbend/Avoid.yml new file mode 100644 index 00000000..dab7822c --- /dev/null +++ b/styles/Lightbend/Avoid.yml @@ -0,0 +1,14 @@ +extends: existence +message: "Don't use '%s'. See the A-Z word list for details." +# See the A-Z word list +link: https://docs.microsoft.com/en-us/style-guide +ignorecase: true +level: error +tokens: + - abortion + - and so on + - app(?:lication)?s? (?:developer|program) + - app(?:lication)? file + - backbone + - backend + - contiguous selection diff --git a/styles/Lightbend/ComplexWords.yml b/styles/Lightbend/ComplexWords.yml new file mode 100644 index 00000000..65b7a347 --- /dev/null +++ b/styles/Lightbend/ComplexWords.yml @@ -0,0 +1,120 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: suggestion +action: + name: replace +swap: + "approximate(?:ly)?": about + abundance: plenty + accelerate: speed up + accentuate: stress + accompany: go with + accomplish: carry out|do + accorded: given + accordingly: so + accrue: add + accurate: right|exact + acquiesce: agree + acquire: get|buy + additional: more|extra + address: discuss + addressees: you + adjacent to: next to + adjustment: change + admissible: allowed + advantageous: helpful + advise: tell + aggregate: total + aircraft: plane + alleviate: ease + allocate: assign|divide + alternatively: or + alternatives: choices|options + ameliorate: improve + amend: change + anticipate: expect + apparent: clear|plain + ascertain: discover|find out + assistance: help + attain: meet + attempt: try + authorize: allow + belated: late + bestow: give + cease: stop|end + collaborate: work together + commence: begin + compensate: pay + component: part + comprise: form|include + concept: idea + concerning: about + confer: give|award + consequently: so + consolidate: merge + constitutes: forms + contains: has + convene: meet + demonstrate: show|prove + depart: leave + designate: choose + desire: want|wish + determine: decide|find + detrimental: bad|harmful + disclose: share|tell + discontinue: stop + disseminate: send|give + eliminate: end + elucidate: explain + employ: use + enclosed: inside|included + encounter: meet + endeavor: try + enumerate: count + equitable: fair + equivalent: equal + exclusively: only + expedite: hurry + facilitate: ease + females: women + finalize: complete|finish + frequently: often + identical: same + incorrect: wrong + indication: sign + initiate: start|begin + itemized: listed + jeopardize: risk + liaise: work with|partner with + maintain: keep|support + methodology: method + modify: change + monitor: check|watch + multiple: many + necessitate: cause + notify: tell + numerous: many + objective: aim|goal + obligate: bind|compel + optimum: best|most + permit: let + portion: part + possess: own + previous: earlier + previously: before + prioritize: rank + procure: buy + provide: give|offer + purchase: buy + relocate: move + solicit: request + state-of-the-art: latest + subsequent: later|next + substantial: large + sufficient: enough + terminate: end + transmit: send + utilization: use + utilize: use diff --git a/styles/Lightbend/Contractions.yml b/styles/Lightbend/Contractions.yml new file mode 100644 index 00000000..fffd2d9c --- /dev/null +++ b/styles/Lightbend/Contractions.yml @@ -0,0 +1,30 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions +level: error +ignorecase: true +action: + name: replace +swap: + are not: aren't + cannot: can't + could not: couldn't + did not: didn't + do not: don't + does not: doesn't + has not: hasn't + have not: haven't + how is: how's + is not: isn't + it is: it's + should not: shouldn't + that is: that's + they are: they're + was not: wasn't + we are: we're + we have: we've + were not: weren't + what is: what's + when is: when's + where is: where's + will not: won't diff --git a/styles/Lightbend/Dashes.yml b/styles/Lightbend/Dashes.yml new file mode 100644 index 00000000..2894cf72 --- /dev/null +++ b/styles/Lightbend/Dashes.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Remove the spaces around '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/emes +ignorecase: true +nonword: true +level: error +action: + name: edit + params: + - remove + - ' ' +tokens: + - '[—–]\s|\s[—–]' diff --git a/styles/Lightbend/DateFormat.yml b/styles/Lightbend/DateFormat.yml new file mode 100644 index 00000000..19653139 --- /dev/null +++ b/styles/Lightbend/DateFormat.yml @@ -0,0 +1,8 @@ +extends: existence +message: Use 'July 31, 2016' format, not '%s'. +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms +ignorecase: true +level: error +nonword: true +tokens: + - '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}' diff --git a/styles/Lightbend/DateNumbers.yml b/styles/Lightbend/DateNumbers.yml new file mode 100644 index 00000000..14d46747 --- /dev/null +++ b/styles/Lightbend/DateNumbers.yml @@ -0,0 +1,40 @@ +extends: existence +message: "Don't use ordinal numbers for dates." +link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates +level: error +nonword: true +ignorecase: true +raw: + - \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?)\b\s* +tokens: + - first + - second + - third + - fourth + - fifth + - sixth + - seventh + - eighth + - ninth + - tenth + - eleventh + - twelfth + - thirteenth + - fourteenth + - fifteenth + - sixteenth + - seventeenth + - eighteenth + - nineteenth + - twentieth + - twenty-first + - twenty-second + - twenty-third + - twenty-fourth + - twenty-fifth + - twenty-sixth + - twenty-seventh + - twenty-eighth + - twenty-ninth + - thirtieth + - thirty-first diff --git a/styles/Lightbend/DateOrder.yml b/styles/Lightbend/DateOrder.yml new file mode 100644 index 00000000..12d69ba5 --- /dev/null +++ b/styles/Lightbend/DateOrder.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Always spell out the name of the month." +link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates +ignorecase: true +level: error +nonword: true +tokens: + - '\b\d{1,2}/\d{1,2}/(?:\d{4}|\d{2})\b' diff --git a/styles/Lightbend/Ellipses.yml b/styles/Lightbend/Ellipses.yml new file mode 100644 index 00000000..320457a8 --- /dev/null +++ b/styles/Lightbend/Ellipses.yml @@ -0,0 +1,9 @@ +extends: existence +message: "In general, don't use an ellipsis." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/ellipses +nonword: true +level: warning +action: + name: remove +tokens: + - '\.\.\.' diff --git a/styles/Lightbend/FirstPerson.yml b/styles/Lightbend/FirstPerson.yml new file mode 100644 index 00000000..77761af8 --- /dev/null +++ b/styles/Lightbend/FirstPerson.yml @@ -0,0 +1,16 @@ +extends: existence +message: "Use first person (such as '%s') sparingly." +link: https://docs.microsoft.com/en-us/style-guide/grammar/person +ignorecase: true +level: warning +nonword: true +tokens: + - (?:^|\s)I\s + - (?:^|\s)I,\s + - \bI'd\b + - \bI'll\b + - \bI'm\b + - \bI've\b + - \bme\b + - \bmy\b + - \bmine\b diff --git a/styles/Lightbend/Foreign.yml b/styles/Lightbend/Foreign.yml new file mode 100644 index 00000000..d37835a5 --- /dev/null +++ b/styles/Lightbend/Foreign.yml @@ -0,0 +1,12 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words +ignorecase: true +level: error +nonword: true +action: + name: replace +swap: + '\b(?:eg|e\.g\.)[\s,]': for example + '\b(?:ie|i\.e\.)[\s,]': that is + diff --git a/styles/Lightbend/Gender.yml b/styles/Lightbend/Gender.yml new file mode 100644 index 00000000..47c08024 --- /dev/null +++ b/styles/Lightbend/Gender.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Don't use '%s'." +link: https://github.com/MicrosoftDocs/microsoft-style-guide/blob/master/styleguide/grammar/nouns-pronouns.md#pronouns-and-gender +level: error +ignorecase: true +tokens: + - he/she + - s/he diff --git a/styles/Lightbend/GenderBias.yml b/styles/Lightbend/GenderBias.yml new file mode 100644 index 00000000..3d873aa3 --- /dev/null +++ b/styles/Lightbend/GenderBias.yml @@ -0,0 +1,44 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +ignorecase: true +level: error +swap: + (?:alumna|alumnus): graduate + (?:alumnae|alumni): graduates + air(?:m[ae]n|wom[ae]n): pilot(s) + anchor(?:m[ae]n|wom[ae]n): anchor(s) + authoress: author + camera(?:m[ae]n|wom[ae]n): camera operator(s) + chair(?:m[ae]n|wom[ae]n): chair(s) + congress(?:m[ae]n|wom[ae]n): member(s) of congress + door(?:m[ae]|wom[ae]n): concierge(s) + draft(?:m[ae]n|wom[ae]n): drafter(s) + fire(?:m[ae]n|wom[ae]n): firefighter(s) + fisher(?:m[ae]n|wom[ae]n): fisher(s) + fresh(?:m[ae]n|wom[ae]n): first-year student(s) + garbage(?:m[ae]n|wom[ae]n): waste collector(s) + lady lawyer: lawyer + ladylike: courteous + landlord: building manager + mail(?:m[ae]n|wom[ae]n): mail carriers + man and wife: husband and wife + man enough: strong enough + mankind: human kind + manmade: manufactured + manpower: personnel + men and girls: men and women + middle(?:m[ae]n|wom[ae]n): intermediary + news(?:m[ae]n|wom[ae]n): journalist(s) + ombuds(?:man|woman): ombuds + oneupmanship: upstaging + poetess: poet + police(?:m[ae]n|wom[ae]n): police officer(s) + repair(?:m[ae]n|wom[ae]n): technician(s) + sales(?:m[ae]n|wom[ae]n): salesperson or sales people + service(?:m[ae]n|wom[ae]n): soldier(s) + steward(?:ess)?: flight attendant + tribes(?:m[ae]n|wom[ae]n): tribe member(s) + waitress: waiter + woman doctor: doctor + woman scientist[s]?: scientist(s) + work(?:m[ae]n|wom[ae]n): worker(s) diff --git a/styles/Lightbend/GeneralURL.yml b/styles/Lightbend/GeneralURL.yml new file mode 100644 index 00000000..dcef503d --- /dev/null +++ b/styles/Lightbend/GeneralURL.yml @@ -0,0 +1,11 @@ +extends: existence +message: "For a general audience, use 'address' rather than 'URL'." +link: https://docs.microsoft.com/en-us/style-guide/urls-web-addresses +level: warning +action: + name: replace + params: + - URL + - address +tokens: + - URL diff --git a/styles/Lightbend/HeadingAcronyms.yml b/styles/Lightbend/HeadingAcronyms.yml new file mode 100644 index 00000000..9dc3b6c2 --- /dev/null +++ b/styles/Lightbend/HeadingAcronyms.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Avoid using acronyms in a title or heading." +link: https://docs.microsoft.com/en-us/style-guide/acronyms#be-careful-with-acronyms-in-titles-and-headings +level: warning +scope: heading +tokens: + - '[A-Z]{2,4}' diff --git a/styles/Lightbend/HeadingColons.yml b/styles/Lightbend/HeadingColons.yml new file mode 100644 index 00000000..7013c391 --- /dev/null +++ b/styles/Lightbend/HeadingColons.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Capitalize '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/colons +nonword: true +level: error +scope: heading +tokens: + - ':\s[a-z]' diff --git a/styles/Lightbend/HeadingPunctuation.yml b/styles/Lightbend/HeadingPunctuation.yml new file mode 100644 index 00000000..af04b02e --- /dev/null +++ b/styles/Lightbend/HeadingPunctuation.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Don't use end punctuation in headings." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods +nonword: true +level: warning +scope: heading +action: + name: edit + params: + - remove + - '.?!' +tokens: + - '[a-z][.?!](?:\s|$)' diff --git a/styles/Lightbend/Headings.yml b/styles/Lightbend/Headings.yml new file mode 100644 index 00000000..63624edc --- /dev/null +++ b/styles/Lightbend/Headings.yml @@ -0,0 +1,28 @@ +extends: capitalization +message: "'%s' should use sentence-style capitalization." +link: https://docs.microsoft.com/en-us/style-guide/capitalization +level: suggestion +scope: heading +match: $sentence +indicators: + - ':' +exceptions: + - Azure + - CLI + - Code + - Cosmos + - Docker + - Emmet + - I + - Kubernetes + - Linux + - macOS + - Marketplace + - MongoDB + - REPL + - Studio + - TypeScript + - URLs + - Visual + - VS + - Windows diff --git a/styles/Lightbend/Hyphens.yml b/styles/Lightbend/Hyphens.yml new file mode 100644 index 00000000..90bbb5de --- /dev/null +++ b/styles/Lightbend/Hyphens.yml @@ -0,0 +1,14 @@ +extends: existence +message: "'%s' doesn't need a hyphen." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens +level: warning +ignorecase: false +nonword: true +action: + name: edit + params: + - replace + - '-' + - ' ' +tokens: + - '\s[^\s-]+ly-' diff --git a/styles/Lightbend/Ordinal.yml b/styles/Lightbend/Ordinal.yml new file mode 100644 index 00000000..e3483e38 --- /dev/null +++ b/styles/Lightbend/Ordinal.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Don't add -ly to an ordinal number." +link: https://docs.microsoft.com/en-us/style-guide/numbers +level: error +action: + name: edit + params: + - trim + - ly +tokens: + - firstly + - secondly + - thirdly diff --git a/styles/Lightbend/OxfordComma.yml b/styles/Lightbend/OxfordComma.yml new file mode 100644 index 00000000..493b55c3 --- /dev/null +++ b/styles/Lightbend/OxfordComma.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Use the Oxford comma in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/commas +scope: sentence +level: suggestion +nonword: true +tokens: + - '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]' diff --git a/styles/Lightbend/Passive.yml b/styles/Lightbend/Passive.yml new file mode 100644 index 00000000..102d377c --- /dev/null +++ b/styles/Lightbend/Passive.yml @@ -0,0 +1,183 @@ +extends: existence +message: "'%s' looks like passive voice." +ignorecase: true +level: suggestion +raw: + - \b(am|are|were|being|is|been|was|be)\b\s* +tokens: + - '[\w]+ed' + - awoken + - beat + - become + - been + - begun + - bent + - beset + - bet + - bid + - bidden + - bitten + - bled + - blown + - born + - bought + - bound + - bred + - broadcast + - broken + - brought + - built + - burnt + - burst + - cast + - caught + - chosen + - clung + - come + - cost + - crept + - cut + - dealt + - dived + - done + - drawn + - dreamt + - driven + - drunk + - dug + - eaten + - fallen + - fed + - felt + - fit + - fled + - flown + - flung + - forbidden + - foregone + - forgiven + - forgotten + - forsaken + - fought + - found + - frozen + - given + - gone + - gotten + - ground + - grown + - heard + - held + - hidden + - hit + - hung + - hurt + - kept + - knelt + - knit + - known + - laid + - lain + - leapt + - learnt + - led + - left + - lent + - let + - lighted + - lost + - made + - meant + - met + - misspelt + - mistaken + - mown + - overcome + - overdone + - overtaken + - overthrown + - paid + - pled + - proven + - put + - quit + - read + - rid + - ridden + - risen + - run + - rung + - said + - sat + - sawn + - seen + - sent + - set + - sewn + - shaken + - shaven + - shed + - shod + - shone + - shorn + - shot + - shown + - shrunk + - shut + - slain + - slept + - slid + - slit + - slung + - smitten + - sold + - sought + - sown + - sped + - spent + - spilt + - spit + - split + - spoken + - spread + - sprung + - spun + - stolen + - stood + - stridden + - striven + - struck + - strung + - stuck + - stung + - stunk + - sung + - sunk + - swept + - swollen + - sworn + - swum + - swung + - taken + - taught + - thought + - thrived + - thrown + - thrust + - told + - torn + - trodden + - understood + - upheld + - upset + - wed + - wept + - withheld + - withstood + - woken + - won + - worn + - wound + - woven + - written + - wrung diff --git a/styles/Lightbend/Percentages.yml b/styles/Lightbend/Percentages.yml new file mode 100644 index 00000000..b68a7363 --- /dev/null +++ b/styles/Lightbend/Percentages.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Use a numeral plus the units." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +tokens: + - '\b[a-zA-z]+\spercent\b' diff --git a/styles/Lightbend/Quotes.yml b/styles/Lightbend/Quotes.yml new file mode 100644 index 00000000..38f49760 --- /dev/null +++ b/styles/Lightbend/Quotes.yml @@ -0,0 +1,7 @@ +extends: existence +message: 'Punctuation should be inside the quotes.' +link: https://docs.microsoft.com/en-us/style-guide/punctuation/quotation-marks +level: error +nonword: true +tokens: + - '["“][^"”“]+["”][.,]' diff --git a/styles/Lightbend/RangeFormat.yml b/styles/Lightbend/RangeFormat.yml new file mode 100644 index 00000000..f1d736e9 --- /dev/null +++ b/styles/Lightbend/RangeFormat.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Use an en dash in a range of numbers." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +action: + name: edit + params: + - replace + - '-' + - '–' +tokens: + - '\b\d+\s?[-]\s?\d+\b' diff --git a/styles/Lightbend/RangeTime.yml b/styles/Lightbend/RangeTime.yml new file mode 100644 index 00000000..cdd4b334 --- /dev/null +++ b/styles/Lightbend/RangeTime.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Use 'to' instead of a dash in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +action: + name: edit + params: + - replace + - '[-–]' + - 'to' +tokens: + - '\b(?:AM|PM)\s?[-–]\s?.+(?:AM|PM)\b' diff --git a/styles/Lightbend/Ranges.yml b/styles/Lightbend/Ranges.yml new file mode 100644 index 00000000..67d9702b --- /dev/null +++ b/styles/Lightbend/Ranges.yml @@ -0,0 +1,7 @@ +extends: existence +message: "In most cases, use 'from' or 'through' to describe a range of numbers." +link: 'https://docs.microsoft.com/en-us/style-guide/numbers' +nonword: true +level: warning +tokens: + - '\b\d+\s?[-–]\s?\d+\b' diff --git a/styles/Lightbend/Readability.yml b/styles/Lightbend/Readability.yml new file mode 100644 index 00000000..8f3c4b17 --- /dev/null +++ b/styles/Lightbend/Readability.yml @@ -0,0 +1,11 @@ +extends: readability +message: "Grade level (%s) too high!" +link: https://docs.errata.ai/vale/styles#readability +level: warning +grade: 10 +metrics: + - Flesch-Kincaid + - Gunning Fog + - Coleman-Liau + - SMOG + - Automated Readability \ No newline at end of file diff --git a/styles/Lightbend/Semicolon.yml b/styles/Lightbend/Semicolon.yml new file mode 100644 index 00000000..4d905467 --- /dev/null +++ b/styles/Lightbend/Semicolon.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Try to simplify this sentence." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/semicolons +nonword: true +scope: sentence +level: suggestion +tokens: + - ';' diff --git a/styles/Lightbend/SentenceLength.yml b/styles/Lightbend/SentenceLength.yml new file mode 100644 index 00000000..f248cf05 --- /dev/null +++ b/styles/Lightbend/SentenceLength.yml @@ -0,0 +1,7 @@ +extends: occurrence +message: "Try to keep sentences short (< 30 words)." +scope: sentence +level: suggestion +max: 30 +token: \b(\w+)\b + diff --git a/styles/Lightbend/Spacing.yml b/styles/Lightbend/Spacing.yml new file mode 100644 index 00000000..c94d0606 --- /dev/null +++ b/styles/Lightbend/Spacing.yml @@ -0,0 +1,7 @@ +extends: existence +message: "'%s' should have one or two spaces." +level: error +nonword: true +tokens: + - '[a-z][.?!] {3,}[A-Z]' + - '[a-z][.?!][A-Z]' diff --git a/styles/Lightbend/Suspended.yml b/styles/Lightbend/Suspended.yml new file mode 100644 index 00000000..7282e9c9 --- /dev/null +++ b/styles/Lightbend/Suspended.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Don't use '%s' unless space is limited." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens +ignorecase: true +level: warning +tokens: + - '\w+- and \w+-' diff --git a/styles/Lightbend/Terms.yml b/styles/Lightbend/Terms.yml new file mode 100644 index 00000000..e41ff74b --- /dev/null +++ b/styles/Lightbend/Terms.yml @@ -0,0 +1,43 @@ +extends: substitution +message: "Prefer '%s' over '%s'." +level: warning +ignorecase: true +action: + name: replace +swap: + '(?:agent|virtual assistant|intelligent personal assistant)': personal digital assistant + '(?:drive C:|drive C>|C: drive)': drive C + '(?:internet bot|web robot)s?': bot(s) + '(?:microsoft cloud|the cloud)': cloud + '(?:mobile|smart) ?phone': phone + '24/7': every day + 'audio(?:-| )book': audiobook + 'back(?:-| )light': backlight + 'chat ?bots?': chatbot(s) + adaptor: adapter + administrate: administer + afterwards: afterward + alphabetic: alphabetical + alphanumerical: alphanumeric + anti-aliasing: antialiasing + anti-malware: antimalware + anti-spyware: antispyware + anti-virus: antivirus + appendixes: appendices + artificial intelligence: artificial intelligence + assembler: assembly language + bpp: bpp + bps: bps + caap: CaaP + conversation-as-a-platform: conversation as a platform + eb: EB + gb: GB + gbps: Gbps + kb: KB + keypress: keystroke + mb: MB + pb: PB + tb: TB + zb: ZB + viz: namely + ergo: therefore diff --git a/styles/Lightbend/URLFormat.yml b/styles/Lightbend/URLFormat.yml new file mode 100644 index 00000000..82e702f9 --- /dev/null +++ b/styles/Lightbend/URLFormat.yml @@ -0,0 +1,10 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +ignorecase: true +level: error +action: + name: replace +swap: + URL for: URL of + an URL: a URL + diff --git a/styles/Lightbend/Units.yml b/styles/Lightbend/Units.yml new file mode 100644 index 00000000..f062418e --- /dev/null +++ b/styles/Lightbend/Units.yml @@ -0,0 +1,16 @@ +extends: existence +message: "Don't spell out the number in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/units-of-measure-terms +level: error +raw: + - '[a-zA-Z]+\s' +tokens: + - '(?:centi|milli)?meters' + - '(?:kilo)?grams' + - '(?:kilo)?meters' + - '(?:mega)?pixels' + - cm + - inches + - lb + - miles + - pounds diff --git a/styles/Lightbend/Vocab.yml b/styles/Lightbend/Vocab.yml new file mode 100644 index 00000000..eebe97b1 --- /dev/null +++ b/styles/Lightbend/Vocab.yml @@ -0,0 +1,25 @@ +extends: existence +message: "Verify your use of '%s' with the A-Z word list." +link: 'https://docs.microsoft.com/en-us/style-guide' +level: suggestion +ignorecase: true +tokens: + - above + - accessible + - actionable + - against + - alarm + - alert + - alias + - allows? + - and/or + - as well as + - assure + - author + - avg + - beta + - ensure + - he + - insure + - sample + - she diff --git a/styles/Lightbend/We.yml b/styles/Lightbend/We.yml new file mode 100644 index 00000000..97c901c1 --- /dev/null +++ b/styles/Lightbend/We.yml @@ -0,0 +1,11 @@ +extends: existence +message: "Try to avoid using first-person plural like '%s'." +link: https://docs.microsoft.com/en-us/style-guide/grammar/person#avoid-first-person-plural +level: warning +ignorecase: true +tokens: + - we + - we'(?:ve|re) + - ours? + - us + - let's diff --git a/styles/Lightbend/Wordiness.yml b/styles/Lightbend/Wordiness.yml new file mode 100644 index 00000000..22a4c932 --- /dev/null +++ b/styles/Lightbend/Wordiness.yml @@ -0,0 +1,122 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: warning +action: + name: replace +swap: + (?:give|gave) rise to: lead to + (?:previous|prior) to: before + a (?:large)? majority of: most + a (?:large)? number of: many + a myriad of: myriad + adversely impact: hurt + all across: across + all of a sudden: suddenly + all of these: these + all of: all + all-time record: record + almost all: most + almost never: seldom + along the lines of: similar to + an adequate number of: enough + an appreciable number of: many + an estimated: about + any and all: all + are in agreement: agree + as a matter of fact: in fact + as a means of: to + as a result of: because of + as of yet: yet + as per: per + at a later date: later + at all times: always + at the present time: now + at this point in time: at this point + based in large part on: based on + based on the fact that: because + basic necessity: necessity + because of the fact that: because + came to a realization: realized + came to an abrupt end: ended abruptly + carry out an evaluation of: evaluate + close down: close + closed down: closed + complete stranger: stranger + completely separate: separate + concerning the matter of: regarding + conduct a review of: review + conduct an investigation: investigate + conduct experiments: experiment + continue on: continue + despite the fact that: although + disappear from sight: disappear + drag and drop: drag + drag-and-drop: drag + doomed to fail: doomed + due to the fact that: because + during the period of: during + during the time that: while + emergency situation: emergency + except when: unless + excessive number: too many + extend an invitation: invite + fall down: fall + fell down: fell + for the duration of: during + gather together: gather + has the ability to: can + has the capacity to: can + has the opportunity to: could + hold a meeting: meet + if this is not the case: if not + in a careful manner: carefully + in a thoughtful manner: thoughtfully + in a timely manner: timely + in an effort to: to + in between: between + in lieu of: instead of + in many cases: often + in most cases: usually + in order to: to + in some cases: sometimes + in spite of the fact that: although + in spite of: despite + in the (?:very)? near future: soon + in the event that: if + in the neighborhood of: roughly + in the vicinity of: close to + it would appear that: apparently + lift up: lift + made reference to: referred to + make reference to: refer to + mix together: mix + none at all: none + not in a position to: unable + not possible: impossible + of major importance: important + perform an assessment of: assess + pertaining to: about + place an order: order + plays a key role in: is essential to + present time: now + readily apparent: apparent + some of the: some + span across: span + subsequent to: after + successfully complete: complete + sufficient number (?:of)?: enough + take action: act + take into account: consider + the question as to whether: whether + there is no doubt but that: doubtless + this day and age: this age + this is a subject that: this subject + time (?:frame|period): time + under the provisions of: under + until such time as: until + used for fuel purposes: used for fuel + whether or not: whether + with regard to: regarding + with the exception of: except for diff --git a/styles/Lightbend/meta.json b/styles/Lightbend/meta.json new file mode 100644 index 00000000..297719bb --- /dev/null +++ b/styles/Lightbend/meta.json @@ -0,0 +1,4 @@ +{ + "feed": "https://github.com/errata-ai/Microsoft/releases.atom", + "vale_version": ">=1.0.0" +} diff --git a/styles/Microsoft/AMPM.yml b/styles/Microsoft/AMPM.yml new file mode 100644 index 00000000..8b9fed16 --- /dev/null +++ b/styles/Microsoft/AMPM.yml @@ -0,0 +1,9 @@ +extends: existence +message: Use 'AM' or 'PM' (preceded by a space). +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms +level: error +nonword: true +tokens: + - '\d{1,2}[AP]M' + - '\d{1,2} ?[ap]m' + - '\d{1,2} ?[aApP]\.[mM]\.' diff --git a/styles/Microsoft/Accessibility.yml b/styles/Microsoft/Accessibility.yml new file mode 100644 index 00000000..05bf9273 --- /dev/null +++ b/styles/Microsoft/Accessibility.yml @@ -0,0 +1,25 @@ +extends: existence +message: "Don't use language (such as '%s') that defines people by their disability." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms +level: suggestion +ignorecase: true +tokens: + - a victim of + - able-bodied + - affected by + - an epileptic + - crippled + - disabled + - dumb + - handicapped + - handicaps + - healthy + - lame + - maimed + - missing a limb + - mute + - normal + - sight-impaired + - stricken with + - suffers from + - vision-impaired diff --git a/styles/Microsoft/Acronyms.yml b/styles/Microsoft/Acronyms.yml new file mode 100644 index 00000000..308ff7c0 --- /dev/null +++ b/styles/Microsoft/Acronyms.yml @@ -0,0 +1,64 @@ +extends: conditional +message: "'%s' has no definition." +link: https://docs.microsoft.com/en-us/style-guide/acronyms +level: suggestion +ignorecase: false +# Ensures that the existence of 'first' implies the existence of 'second'. +first: '\b([A-Z]{3,5})\b' +second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)' +# ... with the exception of these: +exceptions: + - API + - ASP + - CLI + - CPU + - CSS + - CSV + - DEBUG + - DOM + - DPI + - FAQ + - GCC + - GDB + - GET + - GPU + - GTK + - GUI + - HTML + - HTTP + - HTTPS + - IDE + - JAR + - JSON + - JSX + - LESS + - LLDB + - NET + - NOTE + - NVDA + - OSS + - PATH + - PDF + - PHP + - POST + - RAM + - REPL + - RSA + - SCM + - SCSS + - SDK + - SQL + - SSH + - SSL + - SVG + - TBD + - TCP + - TODO + - URI + - URL + - USB + - UTF + - XML + - XSS + - YAML + - ZIP diff --git a/styles/Microsoft/Adverbs.yml b/styles/Microsoft/Adverbs.yml new file mode 100644 index 00000000..07d98d83 --- /dev/null +++ b/styles/Microsoft/Adverbs.yml @@ -0,0 +1,270 @@ +extends: existence +message: "Consider removing '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: warning +action: + name: remove +tokens: + - abnormally + - absentmindedly + - accidentally + - adventurously + - anxiously + - arrogantly + - awkwardly + - bashfully + - beautifully + - bitterly + - bleakly + - blindly + - blissfully + - boastfully + - boldly + - bravely + - briefly + - brightly + - briskly + - broadly + - busily + - calmly + - carefully + - carelessly + - cautiously + - cheerfully + - cleverly + - closely + - coaxingly + - colorfully + - continually + - coolly + - courageously + - crossly + - cruelly + - curiously + - daintily + - dearly + - deceivingly + - deeply + - defiantly + - deliberately + - delightfully + - diligently + - dimly + - doubtfully + - dreamily + - easily + - elegantly + - energetically + - enormously + - enthusiastically + - excitedly + - extremely + - fairly + - faithfully + - famously + - ferociously + - fervently + - fiercely + - fondly + - foolishly + - fortunately + - frankly + - frantically + - freely + - frenetically + - frightfully + - furiously + - generally + - generously + - gently + - gladly + - gleefully + - gracefully + - gratefully + - greatly + - greedily + - happily + - hastily + - healthily + - heavily + - helplessly + - honestly + - hopelessly + - hungrily + - innocently + - inquisitively + - intensely + - intently + - interestingly + - inwardly + - irritably + - jaggedly + - jealously + - jovially + - joyfully + - joyously + - jubilantly + - judgmentally + - justly + - keenly + - kiddingly + - kindheartedly + - knavishly + - knowingly + - knowledgeably + - lazily + - lightly + - limply + - lively + - loftily + - longingly + - loosely + - loudly + - lovingly + - loyally + - madly + - majestically + - meaningfully + - mechanically + - merrily + - miserably + - mockingly + - mortally + - mysteriously + - naturally + - nearly + - neatly + - nervously + - nicely + - noisily + - obediently + - obnoxiously + - oddly + - offensively + - optimistically + - overconfidently + - painfully + - partially + - patiently + - perfectly + - playfully + - politely + - poorly + - positively + - potentially + - powerfully + - promptly + - properly + - punctually + - quaintly + - queasily + - queerly + - questionably + - quickly + - quietly + - quirkily + - quizzically + - randomly + - rapidly + - rarely + - readily + - really + - reassuringly + - recklessly + - regularly + - reluctantly + - repeatedly + - reproachfully + - restfully + - righteously + - rightfully + - rigidly + - roughly + - rudely + - safely + - scarcely + - scarily + - searchingly + - sedately + - seemingly + - selfishly + - separately + - seriously + - shakily + - sharply + - sheepishly + - shrilly + - shyly + - silently + - sleepily + - slowly + - smoothly + - softly + - solemnly + - solidly + - speedily + - stealthily + - sternly + - strictly + - suddenly + - supposedly + - surprisingly + - suspiciously + - sweetly + - swiftly + - sympathetically + - tenderly + - tensely + - terribly + - thankfully + - thoroughly + - thoughtfully + - tightly + - tremendously + - triumphantly + - truthfully + - ultimately + - unabashedly + - unaccountably + - unbearably + - unethically + - unexpectedly + - unfortunately + - unimpressively + - unnaturally + - unnecessarily + - urgently + - usefully + - uselessly + - utterly + - vacantly + - vaguely + - vainly + - valiantly + - vastly + - verbally + - very + - viciously + - victoriously + - violently + - vivaciously + - voluntarily + - warmly + - weakly + - wearily + - wetly + - wholly + - wildly + - willfully + - wisely + - woefully + - wonderfully + - worriedly + - yawningly + - yearningly + - yieldingly + - youthfully + - zealously + - zestfully + - zestily diff --git a/styles/Microsoft/Auto.yml b/styles/Microsoft/Auto.yml new file mode 100644 index 00000000..4da43935 --- /dev/null +++ b/styles/Microsoft/Auto.yml @@ -0,0 +1,11 @@ +extends: existence +message: "In general, don't hyphenate '%s'." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/a/auto +ignorecase: true +level: error +action: + name: convert + params: + - simple +tokens: + - 'auto-\w+' diff --git a/styles/Microsoft/Avoid.yml b/styles/Microsoft/Avoid.yml new file mode 100644 index 00000000..dab7822c --- /dev/null +++ b/styles/Microsoft/Avoid.yml @@ -0,0 +1,14 @@ +extends: existence +message: "Don't use '%s'. See the A-Z word list for details." +# See the A-Z word list +link: https://docs.microsoft.com/en-us/style-guide +ignorecase: true +level: error +tokens: + - abortion + - and so on + - app(?:lication)?s? (?:developer|program) + - app(?:lication)? file + - backbone + - backend + - contiguous selection diff --git a/styles/Microsoft/ComplexWords.yml b/styles/Microsoft/ComplexWords.yml new file mode 100644 index 00000000..65b7a347 --- /dev/null +++ b/styles/Microsoft/ComplexWords.yml @@ -0,0 +1,120 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: suggestion +action: + name: replace +swap: + "approximate(?:ly)?": about + abundance: plenty + accelerate: speed up + accentuate: stress + accompany: go with + accomplish: carry out|do + accorded: given + accordingly: so + accrue: add + accurate: right|exact + acquiesce: agree + acquire: get|buy + additional: more|extra + address: discuss + addressees: you + adjacent to: next to + adjustment: change + admissible: allowed + advantageous: helpful + advise: tell + aggregate: total + aircraft: plane + alleviate: ease + allocate: assign|divide + alternatively: or + alternatives: choices|options + ameliorate: improve + amend: change + anticipate: expect + apparent: clear|plain + ascertain: discover|find out + assistance: help + attain: meet + attempt: try + authorize: allow + belated: late + bestow: give + cease: stop|end + collaborate: work together + commence: begin + compensate: pay + component: part + comprise: form|include + concept: idea + concerning: about + confer: give|award + consequently: so + consolidate: merge + constitutes: forms + contains: has + convene: meet + demonstrate: show|prove + depart: leave + designate: choose + desire: want|wish + determine: decide|find + detrimental: bad|harmful + disclose: share|tell + discontinue: stop + disseminate: send|give + eliminate: end + elucidate: explain + employ: use + enclosed: inside|included + encounter: meet + endeavor: try + enumerate: count + equitable: fair + equivalent: equal + exclusively: only + expedite: hurry + facilitate: ease + females: women + finalize: complete|finish + frequently: often + identical: same + incorrect: wrong + indication: sign + initiate: start|begin + itemized: listed + jeopardize: risk + liaise: work with|partner with + maintain: keep|support + methodology: method + modify: change + monitor: check|watch + multiple: many + necessitate: cause + notify: tell + numerous: many + objective: aim|goal + obligate: bind|compel + optimum: best|most + permit: let + portion: part + possess: own + previous: earlier + previously: before + prioritize: rank + procure: buy + provide: give|offer + purchase: buy + relocate: move + solicit: request + state-of-the-art: latest + subsequent: later|next + substantial: large + sufficient: enough + terminate: end + transmit: send + utilization: use + utilize: use diff --git a/styles/Microsoft/Contractions.yml b/styles/Microsoft/Contractions.yml new file mode 100644 index 00000000..ded330f7 --- /dev/null +++ b/styles/Microsoft/Contractions.yml @@ -0,0 +1,50 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-contractions +level: error +ignorecase: true +action: + name: replace +swap: + are not: aren't + cannot: can't + could not: couldn't + did not: didn't + do not: don't + does not: doesn't + has not: hasn't + have not: haven't + how is: how's + is not: isn't + + 'it is(?!\.)': it's + 'it''s(?=\.)': it is + + should not: shouldn't + + 'that is(?!\.)': that's + 'that''s(?=\.)': that is + + 'they are(?!\.)': they're + 'they''re(?=\.)': they are + + was not: wasn't + + 'we are(?!\.)': we're + 'we''re(?=\.)': we are + + 'we have(?!\.)': we've + 'we''ve(?=\.)': we have + + were not: weren't + + 'what is(?!\.)': what's + 'what''s(?=\.)': what is + + 'when is(?!\.)': when's + 'when''s(?=\.)': when is + + 'where is(?!\.)': where's + 'where''s(?=\.)': where is + + will not: won't diff --git a/styles/Microsoft/Dashes.yml b/styles/Microsoft/Dashes.yml new file mode 100644 index 00000000..2894cf72 --- /dev/null +++ b/styles/Microsoft/Dashes.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Remove the spaces around '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/emes +ignorecase: true +nonword: true +level: error +action: + name: edit + params: + - remove + - ' ' +tokens: + - '[—–]\s|\s[—–]' diff --git a/styles/Microsoft/DateFormat.yml b/styles/Microsoft/DateFormat.yml new file mode 100644 index 00000000..19653139 --- /dev/null +++ b/styles/Microsoft/DateFormat.yml @@ -0,0 +1,8 @@ +extends: existence +message: Use 'July 31, 2016' format, not '%s'. +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms +ignorecase: true +level: error +nonword: true +tokens: + - '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?) \d{4}' diff --git a/styles/Microsoft/DateNumbers.yml b/styles/Microsoft/DateNumbers.yml new file mode 100644 index 00000000..14d46747 --- /dev/null +++ b/styles/Microsoft/DateNumbers.yml @@ -0,0 +1,40 @@ +extends: existence +message: "Don't use ordinal numbers for dates." +link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates +level: error +nonword: true +ignorecase: true +raw: + - \b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)|May|Jun(?:e)|Jul(?:y)|Aug(?:ust)|Sep(?:tember)?|Oct(?:ober)|Nov(?:ember)?|Dec(?:ember)?)\b\s* +tokens: + - first + - second + - third + - fourth + - fifth + - sixth + - seventh + - eighth + - ninth + - tenth + - eleventh + - twelfth + - thirteenth + - fourteenth + - fifteenth + - sixteenth + - seventeenth + - eighteenth + - nineteenth + - twentieth + - twenty-first + - twenty-second + - twenty-third + - twenty-fourth + - twenty-fifth + - twenty-sixth + - twenty-seventh + - twenty-eighth + - twenty-ninth + - thirtieth + - thirty-first diff --git a/styles/Microsoft/DateOrder.yml b/styles/Microsoft/DateOrder.yml new file mode 100644 index 00000000..12d69ba5 --- /dev/null +++ b/styles/Microsoft/DateOrder.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Always spell out the name of the month." +link: https://docs.microsoft.com/en-us/style-guide/numbers#numbers-in-dates +ignorecase: true +level: error +nonword: true +tokens: + - '\b\d{1,2}/\d{1,2}/(?:\d{4}|\d{2})\b' diff --git a/styles/Microsoft/Ellipses.yml b/styles/Microsoft/Ellipses.yml new file mode 100644 index 00000000..320457a8 --- /dev/null +++ b/styles/Microsoft/Ellipses.yml @@ -0,0 +1,9 @@ +extends: existence +message: "In general, don't use an ellipsis." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/ellipses +nonword: true +level: warning +action: + name: remove +tokens: + - '\.\.\.' diff --git a/styles/Microsoft/FirstPerson.yml b/styles/Microsoft/FirstPerson.yml new file mode 100644 index 00000000..77761af8 --- /dev/null +++ b/styles/Microsoft/FirstPerson.yml @@ -0,0 +1,16 @@ +extends: existence +message: "Use first person (such as '%s') sparingly." +link: https://docs.microsoft.com/en-us/style-guide/grammar/person +ignorecase: true +level: warning +nonword: true +tokens: + - (?:^|\s)I\s + - (?:^|\s)I,\s + - \bI'd\b + - \bI'll\b + - \bI'm\b + - \bI've\b + - \bme\b + - \bmy\b + - \bmine\b diff --git a/styles/Microsoft/Foreign.yml b/styles/Microsoft/Foreign.yml new file mode 100644 index 00000000..d37835a5 --- /dev/null +++ b/styles/Microsoft/Foreign.yml @@ -0,0 +1,12 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words +ignorecase: true +level: error +nonword: true +action: + name: replace +swap: + '\b(?:eg|e\.g\.)[\s,]': for example + '\b(?:ie|i\.e\.)[\s,]': that is + diff --git a/styles/Microsoft/Gender.yml b/styles/Microsoft/Gender.yml new file mode 100644 index 00000000..47c08024 --- /dev/null +++ b/styles/Microsoft/Gender.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Don't use '%s'." +link: https://github.com/MicrosoftDocs/microsoft-style-guide/blob/master/styleguide/grammar/nouns-pronouns.md#pronouns-and-gender +level: error +ignorecase: true +tokens: + - he/she + - s/he diff --git a/styles/Microsoft/GenderBias.yml b/styles/Microsoft/GenderBias.yml new file mode 100644 index 00000000..3d873aa3 --- /dev/null +++ b/styles/Microsoft/GenderBias.yml @@ -0,0 +1,44 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +ignorecase: true +level: error +swap: + (?:alumna|alumnus): graduate + (?:alumnae|alumni): graduates + air(?:m[ae]n|wom[ae]n): pilot(s) + anchor(?:m[ae]n|wom[ae]n): anchor(s) + authoress: author + camera(?:m[ae]n|wom[ae]n): camera operator(s) + chair(?:m[ae]n|wom[ae]n): chair(s) + congress(?:m[ae]n|wom[ae]n): member(s) of congress + door(?:m[ae]|wom[ae]n): concierge(s) + draft(?:m[ae]n|wom[ae]n): drafter(s) + fire(?:m[ae]n|wom[ae]n): firefighter(s) + fisher(?:m[ae]n|wom[ae]n): fisher(s) + fresh(?:m[ae]n|wom[ae]n): first-year student(s) + garbage(?:m[ae]n|wom[ae]n): waste collector(s) + lady lawyer: lawyer + ladylike: courteous + landlord: building manager + mail(?:m[ae]n|wom[ae]n): mail carriers + man and wife: husband and wife + man enough: strong enough + mankind: human kind + manmade: manufactured + manpower: personnel + men and girls: men and women + middle(?:m[ae]n|wom[ae]n): intermediary + news(?:m[ae]n|wom[ae]n): journalist(s) + ombuds(?:man|woman): ombuds + oneupmanship: upstaging + poetess: poet + police(?:m[ae]n|wom[ae]n): police officer(s) + repair(?:m[ae]n|wom[ae]n): technician(s) + sales(?:m[ae]n|wom[ae]n): salesperson or sales people + service(?:m[ae]n|wom[ae]n): soldier(s) + steward(?:ess)?: flight attendant + tribes(?:m[ae]n|wom[ae]n): tribe member(s) + waitress: waiter + woman doctor: doctor + woman scientist[s]?: scientist(s) + work(?:m[ae]n|wom[ae]n): worker(s) diff --git a/styles/Microsoft/GeneralURL.yml b/styles/Microsoft/GeneralURL.yml new file mode 100644 index 00000000..dcef503d --- /dev/null +++ b/styles/Microsoft/GeneralURL.yml @@ -0,0 +1,11 @@ +extends: existence +message: "For a general audience, use 'address' rather than 'URL'." +link: https://docs.microsoft.com/en-us/style-guide/urls-web-addresses +level: warning +action: + name: replace + params: + - URL + - address +tokens: + - URL diff --git a/styles/Microsoft/HeadingAcronyms.yml b/styles/Microsoft/HeadingAcronyms.yml new file mode 100644 index 00000000..9dc3b6c2 --- /dev/null +++ b/styles/Microsoft/HeadingAcronyms.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Avoid using acronyms in a title or heading." +link: https://docs.microsoft.com/en-us/style-guide/acronyms#be-careful-with-acronyms-in-titles-and-headings +level: warning +scope: heading +tokens: + - '[A-Z]{2,4}' diff --git a/styles/Microsoft/HeadingColons.yml b/styles/Microsoft/HeadingColons.yml new file mode 100644 index 00000000..7013c391 --- /dev/null +++ b/styles/Microsoft/HeadingColons.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Capitalize '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/colons +nonword: true +level: error +scope: heading +tokens: + - ':\s[a-z]' diff --git a/styles/Microsoft/HeadingPunctuation.yml b/styles/Microsoft/HeadingPunctuation.yml new file mode 100644 index 00000000..af04b02e --- /dev/null +++ b/styles/Microsoft/HeadingPunctuation.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Don't use end punctuation in headings." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods +nonword: true +level: warning +scope: heading +action: + name: edit + params: + - remove + - '.?!' +tokens: + - '[a-z][.?!](?:\s|$)' diff --git a/styles/Microsoft/Headings.yml b/styles/Microsoft/Headings.yml new file mode 100644 index 00000000..63624edc --- /dev/null +++ b/styles/Microsoft/Headings.yml @@ -0,0 +1,28 @@ +extends: capitalization +message: "'%s' should use sentence-style capitalization." +link: https://docs.microsoft.com/en-us/style-guide/capitalization +level: suggestion +scope: heading +match: $sentence +indicators: + - ':' +exceptions: + - Azure + - CLI + - Code + - Cosmos + - Docker + - Emmet + - I + - Kubernetes + - Linux + - macOS + - Marketplace + - MongoDB + - REPL + - Studio + - TypeScript + - URLs + - Visual + - VS + - Windows diff --git a/styles/Microsoft/Hyphens.yml b/styles/Microsoft/Hyphens.yml new file mode 100644 index 00000000..90bbb5de --- /dev/null +++ b/styles/Microsoft/Hyphens.yml @@ -0,0 +1,14 @@ +extends: existence +message: "'%s' doesn't need a hyphen." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens +level: warning +ignorecase: false +nonword: true +action: + name: edit + params: + - replace + - '-' + - ' ' +tokens: + - '\s[^\s-]+ly-' diff --git a/styles/Microsoft/Negative.yml b/styles/Microsoft/Negative.yml new file mode 100644 index 00000000..d6ff2f22 --- /dev/null +++ b/styles/Microsoft/Negative.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Form a negative number with an en dash, not a hyphen." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +action: + name: edit + params: + - replace + - '-' + - '–' +tokens: + - '\s-\d+\s' diff --git a/styles/Microsoft/Ordinal.yml b/styles/Microsoft/Ordinal.yml new file mode 100644 index 00000000..e3483e38 --- /dev/null +++ b/styles/Microsoft/Ordinal.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Don't add -ly to an ordinal number." +link: https://docs.microsoft.com/en-us/style-guide/numbers +level: error +action: + name: edit + params: + - trim + - ly +tokens: + - firstly + - secondly + - thirdly diff --git a/styles/Microsoft/OxfordComma.yml b/styles/Microsoft/OxfordComma.yml new file mode 100644 index 00000000..493b55c3 --- /dev/null +++ b/styles/Microsoft/OxfordComma.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Use the Oxford comma in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/commas +scope: sentence +level: suggestion +nonword: true +tokens: + - '(?:[^\s,]+,){1,} \w+ (?:and|or) \w+[.?!]' diff --git a/styles/Microsoft/Passive.yml b/styles/Microsoft/Passive.yml new file mode 100644 index 00000000..102d377c --- /dev/null +++ b/styles/Microsoft/Passive.yml @@ -0,0 +1,183 @@ +extends: existence +message: "'%s' looks like passive voice." +ignorecase: true +level: suggestion +raw: + - \b(am|are|were|being|is|been|was|be)\b\s* +tokens: + - '[\w]+ed' + - awoken + - beat + - become + - been + - begun + - bent + - beset + - bet + - bid + - bidden + - bitten + - bled + - blown + - born + - bought + - bound + - bred + - broadcast + - broken + - brought + - built + - burnt + - burst + - cast + - caught + - chosen + - clung + - come + - cost + - crept + - cut + - dealt + - dived + - done + - drawn + - dreamt + - driven + - drunk + - dug + - eaten + - fallen + - fed + - felt + - fit + - fled + - flown + - flung + - forbidden + - foregone + - forgiven + - forgotten + - forsaken + - fought + - found + - frozen + - given + - gone + - gotten + - ground + - grown + - heard + - held + - hidden + - hit + - hung + - hurt + - kept + - knelt + - knit + - known + - laid + - lain + - leapt + - learnt + - led + - left + - lent + - let + - lighted + - lost + - made + - meant + - met + - misspelt + - mistaken + - mown + - overcome + - overdone + - overtaken + - overthrown + - paid + - pled + - proven + - put + - quit + - read + - rid + - ridden + - risen + - run + - rung + - said + - sat + - sawn + - seen + - sent + - set + - sewn + - shaken + - shaven + - shed + - shod + - shone + - shorn + - shot + - shown + - shrunk + - shut + - slain + - slept + - slid + - slit + - slung + - smitten + - sold + - sought + - sown + - sped + - spent + - spilt + - spit + - split + - spoken + - spread + - sprung + - spun + - stolen + - stood + - stridden + - striven + - struck + - strung + - stuck + - stung + - stunk + - sung + - sunk + - swept + - swollen + - sworn + - swum + - swung + - taken + - taught + - thought + - thrived + - thrown + - thrust + - told + - torn + - trodden + - understood + - upheld + - upset + - wed + - wept + - withheld + - withstood + - woken + - won + - worn + - wound + - woven + - written + - wrung diff --git a/styles/Microsoft/Percentages.yml b/styles/Microsoft/Percentages.yml new file mode 100644 index 00000000..b68a7363 --- /dev/null +++ b/styles/Microsoft/Percentages.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Use a numeral plus the units." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +tokens: + - '\b[a-zA-z]+\spercent\b' diff --git a/styles/Microsoft/Quotes.yml b/styles/Microsoft/Quotes.yml new file mode 100644 index 00000000..38f49760 --- /dev/null +++ b/styles/Microsoft/Quotes.yml @@ -0,0 +1,7 @@ +extends: existence +message: 'Punctuation should be inside the quotes.' +link: https://docs.microsoft.com/en-us/style-guide/punctuation/quotation-marks +level: error +nonword: true +tokens: + - '["“][^"”“]+["”][.,]' diff --git a/styles/Microsoft/RangeFormat.yml b/styles/Microsoft/RangeFormat.yml new file mode 100644 index 00000000..f1d736e9 --- /dev/null +++ b/styles/Microsoft/RangeFormat.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Use an en dash in a range of numbers." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +action: + name: edit + params: + - replace + - '-' + - '–' +tokens: + - '\b\d+\s?[-]\s?\d+\b' diff --git a/styles/Microsoft/RangeTime.yml b/styles/Microsoft/RangeTime.yml new file mode 100644 index 00000000..cdd4b334 --- /dev/null +++ b/styles/Microsoft/RangeTime.yml @@ -0,0 +1,13 @@ +extends: existence +message: "Use 'to' instead of a dash in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/numbers +nonword: true +level: error +action: + name: edit + params: + - replace + - '[-–]' + - 'to' +tokens: + - '\b(?:AM|PM)\s?[-–]\s?.+(?:AM|PM)\b' diff --git a/styles/Microsoft/Ranges.yml b/styles/Microsoft/Ranges.yml new file mode 100644 index 00000000..67d9702b --- /dev/null +++ b/styles/Microsoft/Ranges.yml @@ -0,0 +1,7 @@ +extends: existence +message: "In most cases, use 'from' or 'through' to describe a range of numbers." +link: 'https://docs.microsoft.com/en-us/style-guide/numbers' +nonword: true +level: warning +tokens: + - '\b\d+\s?[-–]\s?\d+\b' diff --git a/styles/Microsoft/Semicolon.yml b/styles/Microsoft/Semicolon.yml new file mode 100644 index 00000000..4d905467 --- /dev/null +++ b/styles/Microsoft/Semicolon.yml @@ -0,0 +1,8 @@ +extends: existence +message: "Try to simplify this sentence." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/semicolons +nonword: true +scope: sentence +level: suggestion +tokens: + - ';' diff --git a/styles/Microsoft/SentenceLength.yml b/styles/Microsoft/SentenceLength.yml new file mode 100644 index 00000000..f248cf05 --- /dev/null +++ b/styles/Microsoft/SentenceLength.yml @@ -0,0 +1,7 @@ +extends: occurrence +message: "Try to keep sentences short (< 30 words)." +scope: sentence +level: suggestion +max: 30 +token: \b(\w+)\b + diff --git a/styles/Microsoft/Spacing.yml b/styles/Microsoft/Spacing.yml new file mode 100644 index 00000000..bbd10e51 --- /dev/null +++ b/styles/Microsoft/Spacing.yml @@ -0,0 +1,8 @@ +extends: existence +message: "'%s' should have one space." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/periods +level: error +nonword: true +tokens: + - '[a-z][.?!] {2,}[A-Z]' + - '[a-z][.?!][A-Z]' diff --git a/styles/Microsoft/Suspended.yml b/styles/Microsoft/Suspended.yml new file mode 100644 index 00000000..7282e9c9 --- /dev/null +++ b/styles/Microsoft/Suspended.yml @@ -0,0 +1,7 @@ +extends: existence +message: "Don't use '%s' unless space is limited." +link: https://docs.microsoft.com/en-us/style-guide/punctuation/dashes-hyphens/hyphens +ignorecase: true +level: warning +tokens: + - '\w+- and \w+-' diff --git a/styles/Microsoft/Terms.yml b/styles/Microsoft/Terms.yml new file mode 100644 index 00000000..e41ff74b --- /dev/null +++ b/styles/Microsoft/Terms.yml @@ -0,0 +1,43 @@ +extends: substitution +message: "Prefer '%s' over '%s'." +level: warning +ignorecase: true +action: + name: replace +swap: + '(?:agent|virtual assistant|intelligent personal assistant)': personal digital assistant + '(?:drive C:|drive C>|C: drive)': drive C + '(?:internet bot|web robot)s?': bot(s) + '(?:microsoft cloud|the cloud)': cloud + '(?:mobile|smart) ?phone': phone + '24/7': every day + 'audio(?:-| )book': audiobook + 'back(?:-| )light': backlight + 'chat ?bots?': chatbot(s) + adaptor: adapter + administrate: administer + afterwards: afterward + alphabetic: alphabetical + alphanumerical: alphanumeric + anti-aliasing: antialiasing + anti-malware: antimalware + anti-spyware: antispyware + anti-virus: antivirus + appendixes: appendices + artificial intelligence: artificial intelligence + assembler: assembly language + bpp: bpp + bps: bps + caap: CaaP + conversation-as-a-platform: conversation as a platform + eb: EB + gb: GB + gbps: Gbps + kb: KB + keypress: keystroke + mb: MB + pb: PB + tb: TB + zb: ZB + viz: namely + ergo: therefore diff --git a/styles/Microsoft/URLFormat.yml b/styles/Microsoft/URLFormat.yml new file mode 100644 index 00000000..82e702f9 --- /dev/null +++ b/styles/Microsoft/URLFormat.yml @@ -0,0 +1,10 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +ignorecase: true +level: error +action: + name: replace +swap: + URL for: URL of + an URL: a URL + diff --git a/styles/Microsoft/Units.yml b/styles/Microsoft/Units.yml new file mode 100644 index 00000000..f062418e --- /dev/null +++ b/styles/Microsoft/Units.yml @@ -0,0 +1,16 @@ +extends: existence +message: "Don't spell out the number in '%s'." +link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/units-of-measure-terms +level: error +raw: + - '[a-zA-Z]+\s' +tokens: + - '(?:centi|milli)?meters' + - '(?:kilo)?grams' + - '(?:kilo)?meters' + - '(?:mega)?pixels' + - cm + - inches + - lb + - miles + - pounds diff --git a/styles/Microsoft/Vocab.yml b/styles/Microsoft/Vocab.yml new file mode 100644 index 00000000..eebe97b1 --- /dev/null +++ b/styles/Microsoft/Vocab.yml @@ -0,0 +1,25 @@ +extends: existence +message: "Verify your use of '%s' with the A-Z word list." +link: 'https://docs.microsoft.com/en-us/style-guide' +level: suggestion +ignorecase: true +tokens: + - above + - accessible + - actionable + - against + - alarm + - alert + - alias + - allows? + - and/or + - as well as + - assure + - author + - avg + - beta + - ensure + - he + - insure + - sample + - she diff --git a/styles/Microsoft/We.yml b/styles/Microsoft/We.yml new file mode 100644 index 00000000..97c901c1 --- /dev/null +++ b/styles/Microsoft/We.yml @@ -0,0 +1,11 @@ +extends: existence +message: "Try to avoid using first-person plural like '%s'." +link: https://docs.microsoft.com/en-us/style-guide/grammar/person#avoid-first-person-plural +level: warning +ignorecase: true +tokens: + - we + - we'(?:ve|re) + - ours? + - us + - let's diff --git a/styles/Microsoft/Wordiness.yml b/styles/Microsoft/Wordiness.yml new file mode 100644 index 00000000..22a4c932 --- /dev/null +++ b/styles/Microsoft/Wordiness.yml @@ -0,0 +1,122 @@ +extends: substitution +message: "Consider using '%s' instead of '%s'." +link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-simple-words-concise-sentences +ignorecase: true +level: warning +action: + name: replace +swap: + (?:give|gave) rise to: lead to + (?:previous|prior) to: before + a (?:large)? majority of: most + a (?:large)? number of: many + a myriad of: myriad + adversely impact: hurt + all across: across + all of a sudden: suddenly + all of these: these + all of: all + all-time record: record + almost all: most + almost never: seldom + along the lines of: similar to + an adequate number of: enough + an appreciable number of: many + an estimated: about + any and all: all + are in agreement: agree + as a matter of fact: in fact + as a means of: to + as a result of: because of + as of yet: yet + as per: per + at a later date: later + at all times: always + at the present time: now + at this point in time: at this point + based in large part on: based on + based on the fact that: because + basic necessity: necessity + because of the fact that: because + came to a realization: realized + came to an abrupt end: ended abruptly + carry out an evaluation of: evaluate + close down: close + closed down: closed + complete stranger: stranger + completely separate: separate + concerning the matter of: regarding + conduct a review of: review + conduct an investigation: investigate + conduct experiments: experiment + continue on: continue + despite the fact that: although + disappear from sight: disappear + drag and drop: drag + drag-and-drop: drag + doomed to fail: doomed + due to the fact that: because + during the period of: during + during the time that: while + emergency situation: emergency + except when: unless + excessive number: too many + extend an invitation: invite + fall down: fall + fell down: fell + for the duration of: during + gather together: gather + has the ability to: can + has the capacity to: can + has the opportunity to: could + hold a meeting: meet + if this is not the case: if not + in a careful manner: carefully + in a thoughtful manner: thoughtfully + in a timely manner: timely + in an effort to: to + in between: between + in lieu of: instead of + in many cases: often + in most cases: usually + in order to: to + in some cases: sometimes + in spite of the fact that: although + in spite of: despite + in the (?:very)? near future: soon + in the event that: if + in the neighborhood of: roughly + in the vicinity of: close to + it would appear that: apparently + lift up: lift + made reference to: referred to + make reference to: refer to + mix together: mix + none at all: none + not in a position to: unable + not possible: impossible + of major importance: important + perform an assessment of: assess + pertaining to: about + place an order: order + plays a key role in: is essential to + present time: now + readily apparent: apparent + some of the: some + span across: span + subsequent to: after + successfully complete: complete + sufficient number (?:of)?: enough + take action: act + take into account: consider + the question as to whether: whether + there is no doubt but that: doubtless + this day and age: this age + this is a subject that: this subject + time (?:frame|period): time + under the provisions of: under + until such time as: until + used for fuel purposes: used for fuel + whether or not: whether + with regard to: regarding + with the exception of: except for diff --git a/styles/Microsoft/meta.json b/styles/Microsoft/meta.json new file mode 100644 index 00000000..297719bb --- /dev/null +++ b/styles/Microsoft/meta.json @@ -0,0 +1,4 @@ +{ + "feed": "https://github.com/errata-ai/Microsoft/releases.atom", + "vale_version": ">=1.0.0" +} diff --git a/styles/Vocab/Base/accept.txt b/styles/Vocab/Base/accept.txt new file mode 100644 index 00000000..fb64ad0a --- /dev/null +++ b/styles/Vocab/Base/accept.txt @@ -0,0 +1,101 @@ +Ack +ACLs +Akka +autoscaling +Autoscaling +kalix +Kalix +antora +Antora +api +API +async +backoffice +Backoffice +boolean +Boolean +brokerless +Buildah +CA's +chatbots +Chatbots +Chai +classname +codegen +config +configs +CRDTs +Ctrl +deserialize +dev +Dockerfile +entityId +failover +github +GitHub +grpcui +grpcurl +gRPCurl +hostname +hostnames +https +interconnectivity +iss +iterable +jwts +JWTs +kafka +Kafka +lightbend +Lightbend +matchers +namespace +newname +npm +npx +onboarding +passivates +plaintext +preconfigured +proto +protobuf +Protobuf +quickstarts +Quickstarts +recurse +redeliveries +rpc +RPC +sbt +scala +Scala +SDKs +SREs +serializable +serverless +Serverless +sharding +signup +smallstep +src +stackdriver +Stackdriver +subcommand +telemedicine +Telemedicine +Tink +tokenid +tokenization +transcoded +transcoding +Transcoding +unary +unexpose +Unexpose +unnested +userid +UUID +UUIDs +zsh +Zsh +dev diff --git a/styles/Vocab/Base/reject.txt b/styles/Vocab/Base/reject.txt new file mode 100644 index 00000000..e69de29b diff --git a/styles/write-good/Cliches.yml b/styles/write-good/Cliches.yml new file mode 100644 index 00000000..c9531438 --- /dev/null +++ b/styles/write-good/Cliches.yml @@ -0,0 +1,702 @@ +extends: existence +message: "Try to avoid using clichés like '%s'." +ignorecase: true +level: warning +tokens: + - a chip off the old block + - a clean slate + - a dark and stormy night + - a far cry + - a fine kettle of fish + - a loose cannon + - a penny saved is a penny earned + - a tough row to hoe + - a word to the wise + - ace in the hole + - acid test + - add insult to injury + - against all odds + - air your dirty laundry + - all fun and games + - all in a day's work + - all talk, no action + - all thumbs + - all your eggs in one basket + - all's fair in love and war + - all's well that ends well + - almighty dollar + - American as apple pie + - an axe to grind + - another day, another dollar + - armed to the teeth + - as luck would have it + - as old as time + - as the crow flies + - at loose ends + - at my wits end + - avoid like the plague + - babe in the woods + - back against the wall + - back in the saddle + - back to square one + - back to the drawing board + - bad to the bone + - badge of honor + - bald faced liar + - ballpark figure + - banging your head against a brick wall + - baptism by fire + - barking up the wrong tree + - bat out of hell + - be all and end all + - beat a dead horse + - beat around the bush + - been there, done that + - beggars can't be choosers + - behind the eight ball + - bend over backwards + - benefit of the doubt + - bent out of shape + - best thing since sliced bread + - bet your bottom dollar + - better half + - better late than never + - better mousetrap + - better safe than sorry + - between a rock and a hard place + - beyond the pale + - bide your time + - big as life + - big cheese + - big fish in a small pond + - big man on campus + - bigger they are the harder they fall + - bird in the hand + - bird's eye view + - birds and the bees + - birds of a feather flock together + - bit the hand that feeds you + - bite the bullet + - bite the dust + - bitten off more than he can chew + - black as coal + - black as pitch + - black as the ace of spades + - blast from the past + - bleeding heart + - blessing in disguise + - blind ambition + - blind as a bat + - blind leading the blind + - blood is thicker than water + - blood sweat and tears + - blow off steam + - blow your own horn + - blushing bride + - boils down to + - bolt from the blue + - bone to pick + - bored stiff + - bored to tears + - bottomless pit + - boys will be boys + - bright and early + - brings home the bacon + - broad across the beam + - broken record + - brought back to reality + - bull by the horns + - bull in a china shop + - burn the midnight oil + - burning question + - burning the candle at both ends + - burst your bubble + - bury the hatchet + - busy as a bee + - by hook or by crook + - call a spade a spade + - called onto the carpet + - calm before the storm + - can of worms + - can't cut the mustard + - can't hold a candle to + - case of mistaken identity + - cat got your tongue + - cat's meow + - caught in the crossfire + - caught red-handed + - checkered past + - chomping at the bit + - cleanliness is next to godliness + - clear as a bell + - clear as mud + - close to the vest + - cock and bull story + - cold shoulder + - come hell or high water + - cool as a cucumber + - cool, calm, and collected + - cost a king's ransom + - count your blessings + - crack of dawn + - crash course + - creature comforts + - cross that bridge when you come to it + - crushing blow + - cry like a baby + - cry me a river + - cry over spilt milk + - crystal clear + - curiosity killed the cat + - cut and dried + - cut through the red tape + - cut to the chase + - cute as a bugs ear + - cute as a button + - cute as a puppy + - cuts to the quick + - dark before the dawn + - day in, day out + - dead as a doornail + - devil is in the details + - dime a dozen + - divide and conquer + - dog and pony show + - dog days + - dog eat dog + - dog tired + - don't burn your bridges + - don't count your chickens + - don't look a gift horse in the mouth + - don't rock the boat + - don't step on anyone's toes + - don't take any wooden nickels + - down and out + - down at the heels + - down in the dumps + - down the hatch + - down to earth + - draw the line + - dressed to kill + - dressed to the nines + - drives me up the wall + - dull as dishwater + - dyed in the wool + - eagle eye + - ear to the ground + - early bird catches the worm + - easier said than done + - easy as pie + - eat your heart out + - eat your words + - eleventh hour + - even the playing field + - every dog has its day + - every fiber of my being + - everything but the kitchen sink + - eye for an eye + - face the music + - facts of life + - fair weather friend + - fall by the wayside + - fan the flames + - feast or famine + - feather your nest + - feathered friends + - few and far between + - fifteen minutes of fame + - filthy vermin + - fine kettle of fish + - fish out of water + - fishing for a compliment + - fit as a fiddle + - fit the bill + - fit to be tied + - flash in the pan + - flat as a pancake + - flip your lid + - flog a dead horse + - fly by night + - fly the coop + - follow your heart + - for all intents and purposes + - for the birds + - for what it's worth + - force of nature + - force to be reckoned with + - forgive and forget + - fox in the henhouse + - free and easy + - free as a bird + - fresh as a daisy + - full steam ahead + - fun in the sun + - garbage in, garbage out + - gentle as a lamb + - get a kick out of + - get a leg up + - get down and dirty + - get the lead out + - get to the bottom of + - get your feet wet + - gets my goat + - gilding the lily + - give and take + - go against the grain + - go at it tooth and nail + - go for broke + - go him one better + - go the extra mile + - go with the flow + - goes without saying + - good as gold + - good deed for the day + - good things come to those who wait + - good time was had by all + - good times were had by all + - greased lightning + - greek to me + - green thumb + - green-eyed monster + - grist for the mill + - growing like a weed + - hair of the dog + - hand to mouth + - happy as a clam + - happy as a lark + - hasn't a clue + - have a nice day + - have high hopes + - have the last laugh + - haven't got a row to hoe + - head honcho + - head over heels + - hear a pin drop + - heard it through the grapevine + - heart's content + - heavy as lead + - hem and haw + - high and dry + - high and mighty + - high as a kite + - hit paydirt + - hold your head up high + - hold your horses + - hold your own + - hold your tongue + - honest as the day is long + - horns of a dilemma + - horse of a different color + - hot under the collar + - hour of need + - I beg to differ + - icing on the cake + - if the shoe fits + - if the shoe were on the other foot + - in a jam + - in a jiffy + - in a nutshell + - in a pig's eye + - in a pinch + - in a word + - in hot water + - in the gutter + - in the nick of time + - in the thick of it + - in your dreams + - it ain't over till the fat lady sings + - it goes without saying + - it takes all kinds + - it takes one to know one + - it's a small world + - it's only a matter of time + - ivory tower + - Jack of all trades + - jockey for position + - jog your memory + - joined at the hip + - judge a book by its cover + - jump down your throat + - jump in with both feet + - jump on the bandwagon + - jump the gun + - jump to conclusions + - just a hop, skip, and a jump + - just the ticket + - justice is blind + - keep a stiff upper lip + - keep an eye on + - keep it simple, stupid + - keep the home fires burning + - keep up with the Joneses + - keep your chin up + - keep your fingers crossed + - kick the bucket + - kick up your heels + - kick your feet up + - kid in a candy store + - kill two birds with one stone + - kiss of death + - knock it out of the park + - knock on wood + - knock your socks off + - know him from Adam + - know the ropes + - know the score + - knuckle down + - knuckle sandwich + - knuckle under + - labor of love + - ladder of success + - land on your feet + - lap of luxury + - last but not least + - last hurrah + - last-ditch effort + - law of the jungle + - law of the land + - lay down the law + - leaps and bounds + - let sleeping dogs lie + - let the cat out of the bag + - let the good times roll + - let your hair down + - let's talk turkey + - letter perfect + - lick your wounds + - lies like a rug + - life's a bitch + - life's a grind + - light at the end of the tunnel + - lighter than a feather + - lighter than air + - like clockwork + - like father like son + - like taking candy from a baby + - like there's no tomorrow + - lion's share + - live and learn + - live and let live + - long and short of it + - long lost love + - look before you leap + - look down your nose + - look what the cat dragged in + - looking a gift horse in the mouth + - looks like death warmed over + - loose cannon + - lose your head + - lose your temper + - loud as a horn + - lounge lizard + - loved and lost + - low man on the totem pole + - luck of the draw + - luck of the Irish + - make hay while the sun shines + - make money hand over fist + - make my day + - make the best of a bad situation + - make the best of it + - make your blood boil + - man of few words + - man's best friend + - mark my words + - meaningful dialogue + - missed the boat on that one + - moment in the sun + - moment of glory + - moment of truth + - money to burn + - more power to you + - more than one way to skin a cat + - movers and shakers + - moving experience + - naked as a jaybird + - naked truth + - neat as a pin + - needle in a haystack + - needless to say + - neither here nor there + - never look back + - never say never + - nip and tuck + - nip it in the bud + - no guts, no glory + - no love lost + - no pain, no gain + - no skin off my back + - no stone unturned + - no time like the present + - no use crying over spilled milk + - nose to the grindstone + - not a hope in hell + - not a minute's peace + - not in my backyard + - not playing with a full deck + - not the end of the world + - not written in stone + - nothing to sneeze at + - nothing ventured nothing gained + - now we're cooking + - off the top of my head + - off the wagon + - off the wall + - old hat + - older and wiser + - older than dirt + - older than Methuselah + - on a roll + - on cloud nine + - on pins and needles + - on the bandwagon + - on the money + - on the nose + - on the rocks + - on the spot + - on the tip of my tongue + - on the wagon + - on thin ice + - once bitten, twice shy + - one bad apple doesn't spoil the bushel + - one born every minute + - one brick short + - one foot in the grave + - one in a million + - one red cent + - only game in town + - open a can of worms + - open and shut case + - open the flood gates + - opportunity doesn't knock twice + - out of pocket + - out of sight, out of mind + - out of the frying pan into the fire + - out of the woods + - out on a limb + - over a barrel + - over the hump + - pain and suffering + - pain in the + - panic button + - par for the course + - part and parcel + - party pooper + - pass the buck + - patience is a virtue + - pay through the nose + - penny pincher + - perfect storm + - pig in a poke + - pile it on + - pillar of the community + - pin your hopes on + - pitter patter of little feet + - plain as day + - plain as the nose on your face + - play by the rules + - play your cards right + - playing the field + - playing with fire + - pleased as punch + - plenty of fish in the sea + - point with pride + - poor as a church mouse + - pot calling the kettle black + - pretty as a picture + - pull a fast one + - pull your punches + - pulling your leg + - pure as the driven snow + - put it in a nutshell + - put one over on you + - put the cart before the horse + - put the pedal to the metal + - put your best foot forward + - put your foot down + - quick as a bunny + - quick as a lick + - quick as a wink + - quick as lightning + - quiet as a dormouse + - rags to riches + - raining buckets + - raining cats and dogs + - rank and file + - rat race + - reap what you sow + - red as a beet + - red herring + - reinvent the wheel + - rich and famous + - rings a bell + - ripe old age + - ripped me off + - rise and shine + - road to hell is paved with good intentions + - rob Peter to pay Paul + - roll over in the grave + - rub the wrong way + - ruled the roost + - running in circles + - sad but true + - sadder but wiser + - salt of the earth + - scared stiff + - scared to death + - sealed with a kiss + - second to none + - see eye to eye + - seen the light + - seize the day + - set the record straight + - set the world on fire + - set your teeth on edge + - sharp as a tack + - shoot for the moon + - shoot the breeze + - shot in the dark + - shoulder to the wheel + - sick as a dog + - sigh of relief + - signed, sealed, and delivered + - sink or swim + - six of one, half a dozen of another + - skating on thin ice + - slept like a log + - slinging mud + - slippery as an eel + - slow as molasses + - smart as a whip + - smooth as a baby's bottom + - sneaking suspicion + - snug as a bug in a rug + - sow wild oats + - spare the rod, spoil the child + - speak of the devil + - spilled the beans + - spinning your wheels + - spitting image of + - spoke with relish + - spread like wildfire + - spring to life + - squeaky wheel gets the grease + - stands out like a sore thumb + - start from scratch + - stick in the mud + - still waters run deep + - stitch in time + - stop and smell the roses + - straight as an arrow + - straw that broke the camel's back + - strong as an ox + - stubborn as a mule + - stuff that dreams are made of + - stuffed shirt + - sweating blood + - sweating bullets + - take a load off + - take one for the team + - take the bait + - take the bull by the horns + - take the plunge + - takes one to know one + - takes two to tango + - the more the merrier + - the real deal + - the real McCoy + - the red carpet treatment + - the same old story + - there is no accounting for taste + - thick as a brick + - thick as thieves + - thin as a rail + - think outside of the box + - third time's the charm + - this day and age + - this hurts me worse than it hurts you + - this point in time + - three sheets to the wind + - through thick and thin + - throw in the towel + - tie one on + - tighter than a drum + - time and time again + - time is of the essence + - tip of the iceberg + - tired but happy + - to coin a phrase + - to each his own + - to make a long story short + - to the best of my knowledge + - toe the line + - tongue in cheek + - too good to be true + - too hot to handle + - too numerous to mention + - touch with a ten foot pole + - tough as nails + - trial and error + - trials and tribulations + - tried and true + - trip down memory lane + - twist of fate + - two cents worth + - two peas in a pod + - ugly as sin + - under the counter + - under the gun + - under the same roof + - under the weather + - until the cows come home + - unvarnished truth + - up the creek + - uphill battle + - upper crust + - upset the applecart + - vain attempt + - vain effort + - vanquish the enemy + - vested interest + - waiting for the other shoe to drop + - wakeup call + - warm welcome + - watch your p's and q's + - watch your tongue + - watching the clock + - water under the bridge + - weather the storm + - weed them out + - week of Sundays + - went belly up + - wet behind the ears + - what goes around comes around + - what you see is what you get + - when it rains, it pours + - when push comes to shove + - when the cat's away + - when the going gets tough, the tough get going + - white as a sheet + - whole ball of wax + - whole hog + - whole nine yards + - wild goose chase + - will wonders never cease? + - wisdom of the ages + - wise as an owl + - wolf at the door + - words fail me + - work like a dog + - world weary + - worst nightmare + - worth its weight in gold + - wrong side of the bed + - yanking your chain + - yappy as a dog + - years young + - you are what you eat + - you can run but you can't hide + - you only live once + - you're the boss + - young and foolish + - young and vibrant diff --git a/styles/write-good/E-Prime.yml b/styles/write-good/E-Prime.yml new file mode 100644 index 00000000..074a102b --- /dev/null +++ b/styles/write-good/E-Prime.yml @@ -0,0 +1,32 @@ +extends: existence +message: "Try to avoid using '%s'." +ignorecase: true +level: suggestion +tokens: + - am + - are + - aren't + - be + - been + - being + - he's + - here's + - here's + - how's + - i'm + - is + - isn't + - it's + - she's + - that's + - there's + - they're + - was + - wasn't + - we're + - were + - weren't + - what's + - where's + - who's + - you're diff --git a/styles/write-good/Illusions.yml b/styles/write-good/Illusions.yml new file mode 100644 index 00000000..b4f13218 --- /dev/null +++ b/styles/write-good/Illusions.yml @@ -0,0 +1,11 @@ +extends: repetition +message: "'%s' is repeated!" +level: warning +alpha: true +action: + name: edit + params: + - truncate + - " " +tokens: + - '[^\s]+' diff --git a/styles/write-good/Passive.yml b/styles/write-good/Passive.yml new file mode 100644 index 00000000..f472cb90 --- /dev/null +++ b/styles/write-good/Passive.yml @@ -0,0 +1,183 @@ +extends: existence +message: "'%s' may be passive voice. Use active voice if you can." +ignorecase: true +level: warning +raw: + - \b(am|are|were|being|is|been|was|be)\b\s* +tokens: + - '[\w]+ed' + - awoken + - beat + - become + - been + - begun + - bent + - beset + - bet + - bid + - bidden + - bitten + - bled + - blown + - born + - bought + - bound + - bred + - broadcast + - broken + - brought + - built + - burnt + - burst + - cast + - caught + - chosen + - clung + - come + - cost + - crept + - cut + - dealt + - dived + - done + - drawn + - dreamt + - driven + - drunk + - dug + - eaten + - fallen + - fed + - felt + - fit + - fled + - flown + - flung + - forbidden + - foregone + - forgiven + - forgotten + - forsaken + - fought + - found + - frozen + - given + - gone + - gotten + - ground + - grown + - heard + - held + - hidden + - hit + - hung + - hurt + - kept + - knelt + - knit + - known + - laid + - lain + - leapt + - learnt + - led + - left + - lent + - let + - lighted + - lost + - made + - meant + - met + - misspelt + - mistaken + - mown + - overcome + - overdone + - overtaken + - overthrown + - paid + - pled + - proven + - put + - quit + - read + - rid + - ridden + - risen + - run + - rung + - said + - sat + - sawn + - seen + - sent + - set + - sewn + - shaken + - shaven + - shed + - shod + - shone + - shorn + - shot + - shown + - shrunk + - shut + - slain + - slept + - slid + - slit + - slung + - smitten + - sold + - sought + - sown + - sped + - spent + - spilt + - spit + - split + - spoken + - spread + - sprung + - spun + - stolen + - stood + - stridden + - striven + - struck + - strung + - stuck + - stung + - stunk + - sung + - sunk + - swept + - swollen + - sworn + - swum + - swung + - taken + - taught + - thought + - thrived + - thrown + - thrust + - told + - torn + - trodden + - understood + - upheld + - upset + - wed + - wept + - withheld + - withstood + - woken + - won + - worn + - wound + - woven + - written + - wrung diff --git a/styles/write-good/README.md b/styles/write-good/README.md new file mode 100644 index 00000000..3edcc9b3 --- /dev/null +++ b/styles/write-good/README.md @@ -0,0 +1,27 @@ +Based on [write-good](https://github.com/btford/write-good). + +> Naive linter for English prose for developers who can't write good and wanna learn to do other stuff good too. + +``` +The MIT License (MIT) + +Copyright (c) 2014 Brian Ford + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/styles/write-good/So.yml b/styles/write-good/So.yml new file mode 100644 index 00000000..e57f099d --- /dev/null +++ b/styles/write-good/So.yml @@ -0,0 +1,5 @@ +extends: existence +message: "Don't start a sentence with '%s'." +level: error +raw: + - '(?:[;-]\s)so[\s,]|\bSo[\s,]' diff --git a/styles/write-good/ThereIs.yml b/styles/write-good/ThereIs.yml new file mode 100644 index 00000000..8b82e8f6 --- /dev/null +++ b/styles/write-good/ThereIs.yml @@ -0,0 +1,6 @@ +extends: existence +message: "Don't start a sentence with '%s'." +ignorecase: false +level: error +raw: + - '(?:[;-]\s)There\s(is|are)|\bThere\s(is|are)\b' diff --git a/styles/write-good/TooWordy.yml b/styles/write-good/TooWordy.yml new file mode 100644 index 00000000..275701b1 --- /dev/null +++ b/styles/write-good/TooWordy.yml @@ -0,0 +1,221 @@ +extends: existence +message: "'%s' is too wordy." +ignorecase: true +level: warning +tokens: + - a number of + - abundance + - accede to + - accelerate + - accentuate + - accompany + - accomplish + - accorded + - accrue + - acquiesce + - acquire + - additional + - adjacent to + - adjustment + - admissible + - advantageous + - adversely impact + - advise + - aforementioned + - aggregate + - aircraft + - all of + - all things considered + - alleviate + - allocate + - along the lines of + - already existing + - alternatively + - amazing + - ameliorate + - anticipate + - apparent + - appreciable + - as a matter of fact + - as a means of + - as far as I'm concerned + - as of yet + - as to + - as yet + - ascertain + - assistance + - at the present time + - at this time + - attain + - attributable to + - authorize + - because of the fact that + - belated + - benefit from + - bestow + - by means of + - by virtue of + - by virtue of the fact that + - cease + - close proximity + - commence + - comply with + - concerning + - consequently + - consolidate + - constitutes + - demonstrate + - depart + - designate + - discontinue + - due to the fact that + - each and every + - economical + - eliminate + - elucidate + - employ + - endeavor + - enumerate + - equitable + - equivalent + - evaluate + - evidenced + - exclusively + - expedite + - expend + - expiration + - facilitate + - factual evidence + - feasible + - finalize + - first and foremost + - for all intents and purposes + - for the most part + - for the purpose of + - forfeit + - formulate + - have a tendency to + - honest truth + - however + - if and when + - impacted + - implement + - in a manner of speaking + - in a timely manner + - in a very real sense + - in accordance with + - in addition + - in all likelihood + - in an effort to + - in between + - in excess of + - in lieu of + - in light of the fact that + - in many cases + - in my opinion + - in order to + - in regard to + - in some instances + - in terms of + - in the case of + - in the event that + - in the final analysis + - in the nature of + - in the near future + - in the process of + - inception + - incumbent upon + - indicate + - indication + - initiate + - irregardless + - is applicable to + - is authorized to + - is responsible for + - it is + - it is essential + - it seems that + - it was + - magnitude + - maximum + - methodology + - minimize + - minimum + - modify + - monitor + - multiple + - necessitate + - nevertheless + - not certain + - not many + - not often + - not unless + - not unlike + - notwithstanding + - null and void + - numerous + - objective + - obligate + - obtain + - on the contrary + - on the other hand + - one particular + - optimum + - overall + - owing to the fact that + - participate + - particulars + - pass away + - pertaining to + - point in time + - portion + - possess + - preclude + - previously + - prior to + - prioritize + - procure + - proficiency + - provided that + - purchase + - put simply + - readily apparent + - refer back + - regarding + - relocate + - remainder + - remuneration + - requirement + - reside + - residence + - retain + - satisfy + - shall + - should you wish + - similar to + - solicit + - span across + - strategize + - subsequent + - substantial + - successfully complete + - sufficient + - terminate + - the month of + - the point I am trying to make + - therefore + - time period + - took advantage of + - transmit + - transpire + - type of + - until such time as + - utilization + - utilize + - validate + - various different + - what I mean to say is + - whether or not + - with respect to + - with the exception of + - witnessed diff --git a/styles/write-good/Weasel.yml b/styles/write-good/Weasel.yml new file mode 100644 index 00000000..e2939144 --- /dev/null +++ b/styles/write-good/Weasel.yml @@ -0,0 +1,207 @@ +extends: existence +message: "'%s' is a weasel word!" +ignorecase: true +level: warning +tokens: + - absolutely + - accidentally + - additionally + - allegedly + - alternatively + - angrily + - anxiously + - approximately + - awkwardly + - badly + - barely + - beautifully + - blindly + - boldly + - bravely + - brightly + - briskly + - bristly + - bubbly + - busily + - calmly + - carefully + - carelessly + - cautiously + - cheerfully + - clearly + - closely + - coldly + - completely + - consequently + - correctly + - courageously + - crinkly + - cruelly + - crumbly + - cuddly + - currently + - daily + - daringly + - deadly + - definitely + - deliberately + - doubtfully + - dumbly + - eagerly + - early + - easily + - elegantly + - enormously + - enthusiastically + - equally + - especially + - eventually + - exactly + - exceedingly + - exclusively + - extremely + - fairly + - faithfully + - fatally + - fiercely + - finally + - fondly + - few + - foolishly + - fortunately + - frankly + - frantically + - generously + - gently + - giggly + - gladly + - gracefully + - greedily + - happily + - hardly + - hastily + - healthily + - heartily + - helpfully + - honestly + - hourly + - hungrily + - hurriedly + - immediately + - impatiently + - inadequately + - ingeniously + - innocently + - inquisitively + - interestingly + - irritably + - jiggly + - joyously + - justly + - kindly + - largely + - lately + - lazily + - likely + - literally + - lonely + - loosely + - loudly + - loudly + - luckily + - madly + - many + - mentally + - mildly + - monthly + - mortally + - mostly + - mysteriously + - neatly + - nervously + - nightly + - noisily + - normally + - obediently + - occasionally + - only + - openly + - painfully + - particularly + - patiently + - perfectly + - politely + - poorly + - powerfully + - presumably + - previously + - promptly + - punctually + - quarterly + - quickly + - quietly + - rapidly + - rarely + - really + - recently + - recklessly + - regularly + - remarkably + - relatively + - reluctantly + - repeatedly + - rightfully + - roughly + - rudely + - sadly + - safely + - selfishly + - sensibly + - seriously + - sharply + - shortly + - shyly + - significantly + - silently + - simply + - sleepily + - slowly + - smartly + - smelly + - smoothly + - softly + - solemnly + - sparkly + - speedily + - stealthily + - sternly + - stupidly + - substantially + - successfully + - suddenly + - surprisingly + - suspiciously + - swiftly + - tenderly + - tensely + - thoughtfully + - tightly + - timely + - truthfully + - unexpectedly + - unfortunately + - usually + - very + - victoriously + - violently + - vivaciously + - warmly + - waverly + - weakly + - wearily + - weekly + - wildly + - wisely + - worldly + - wrinkly + - yearly diff --git a/styles/write-good/meta.json b/styles/write-good/meta.json new file mode 100644 index 00000000..a115d288 --- /dev/null +++ b/styles/write-good/meta.json @@ -0,0 +1,4 @@ +{ + "feed": "https://github.com/errata-ai/write-good/releases.atom", + "vale_version": ">=1.0.0" +}