diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..06b40cec --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,28 @@ +# This is a configuration file for the markdownlint. You can use this file to overwrite the default settings. +# MD013 is set to false by default because many files include lines longer than the conventional 80 character limit +MD013: false +# Disable the Multiple headings with the same content rule +MD024: false +# MD029 is set to false because it generated some issues with longer lists +MD029: false +# Checks if there some inline HTML-elements +MD033: false +# MD044 is used to set capitalization for the particular words. You can determine whether it should be used also for code blocks and html elements +MD044: + code_blocks: false + html_elements: false + names: + - Kyma + - Kubernetes + - ConfigMap + - CronJob + - CustomResourceDefinition + - Ingress + - Node + - PodPreset + - Pod + - ProwJob + - Secret + - ServiceBinding + - ServiceClass + - ServiceInstance \ No newline at end of file diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 00000000..1f7f8995 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1,2 @@ +_sidebar.md +FlowCharts.md diff --git a/docs/contributor/installation.md b/docs/contributor/installation.md index 98f1b9e3..98f4b08d 100644 --- a/docs/contributor/installation.md +++ b/docs/contributor/installation.md @@ -48,7 +48,7 @@ For information about the prerequisites, refer to [Development](./development.md make deploy IMG=$IMG ``` -6. To start the reconciliation process, apply the NATS Custom Resource. +6. To start the reconciliation process, apply the NATS custom resource. ```sh kubectl apply -f config/samples/eventing-nats-eval.yaml diff --git a/docs/contributor/testing.md b/docs/contributor/testing.md index bb692b91..1ac82607 100644 --- a/docs/contributor/testing.md +++ b/docs/contributor/testing.md @@ -12,7 +12,7 @@ This document provides an overview of the testing activities used in this projec > **NOTE:** The validation and defaulting rules are tested within the integration tests. -### Unit tests and Env-tests +### Unit Tests and Env-Tests To run the unit and integration tests, the following command needs to be executed. If necessary, the needed binaries for the integration tests are downloaded to `./bin`. Further information about integration tests can be found in the [Kubebuilder book](https://book.kubebuilder.io/reference/envtest.html). @@ -27,7 +27,7 @@ If changes to the source code were made, or if this is your first time to execut make generate-and-test ``` -### E2E tests +### E2E Tests Because E2E tests need a Kubernetes cluster to run on, they are separate from the remaining tests. diff --git a/docs/user/02-configuration.md b/docs/user/02-configuration.md index f88a26c9..c93f6a81 100644 --- a/docs/user/02-configuration.md +++ b/docs/user/02-configuration.md @@ -55,8 +55,8 @@ Use the following sample CRs as guidance. Each can be applied immediately when y | **resources** | object | Resources defines resources for NATS. | | **resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. | | **resources.​claims.​name** (required) | string | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | -| **resources.​limits** | map\[string\]\{integer or string\} | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | -| **resources.​requests** | map\[string\]\{integer or string\} | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | +| **resources.​limits** | map\[string\]\{integer or string\} | Limits describes the maximum amount of compute resources allowed. Fore more information, check [Resource Management for Pods and Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). | +| **resources.​requests** | map\[string\]\{integer or string\} | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. Fore more information, check [Resource Management for Pods and Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). | **Status:** diff --git a/markdown_heading_capitalization.js b/markdown_heading_capitalization.js new file mode 100644 index 00000000..2fdede35 --- /dev/null +++ b/markdown_heading_capitalization.js @@ -0,0 +1,30 @@ +// This file is used to trigger the custom rule that checks if all markdown headings (words longer than 4 characters) are written in the title case. To run this check, you must include the check in the markdownlint command. +// For example, if you want to run the check on the `docs` folder, run the following command: `markdownlint -r ./markdown_heading_capitalization.js docs/`. +module.exports = [{ + "names": [ "custom/capitalize-headings" ], + "description": "Heading words longer than 4 characters should be capitalized", + "tags": [ "formatting" ], + "function": function rule(params, onError) { + params.tokens.filter(function filterToken(token) { + return token.type === "heading_open"; + }).forEach(function forToken(heading) { + var headingTokenContent = heading.line.trim(); + var wordsInHeading = headingTokenContent.split(' '); + + for (var i = 0; i < wordsInHeading.length; i++) { + if (wordsInHeading[i].length > 4 && wordsInHeading[i] && + wordsInHeading[i].charAt(0) !== wordsInHeading[i].charAt(0).toUpperCase()) { + var capitalizedWord = wordsInHeading[i].charAt(0).toUpperCase() + wordsInHeading[i].slice(1); + var detailMessage = "Change " + "'" + wordsInHeading[i] + "'" + " to " + "'" + capitalizedWord + "'"; + + onError({ + "lineNumber": heading.lineNumber, + "detail": detailMessage, + "context": headingTokenContent, // Show the whole heading as context + "range": [headingTokenContent.indexOf(wordsInHeading[i]), wordsInHeading[i].length] // Underline the word which needs a change + }); + } + } + }); + } + }]; \ No newline at end of file