From e959c269551a49f39132189fad7c6c6de456bcff Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 5 Aug 2024 14:32:35 +0100 Subject: [PATCH 1/9] Fix broken links in API-linting-Implementation-Guideline.md --- .../API-linting-Implementation-Guideline.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index 4b363a27..bbeebdb8 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -2,11 +2,11 @@ ## Introduction -This guide provides instructions on how to implement linting rules for the CAMARA APIs using two methods: **[GitHub Actions](API-linting-Implementation-Guideline.md#github-actions-integration)** and **[local deployment](API-linting-Implementation-Guideline.md#github-actions-integration)**, both methods use [Spectral tool](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview). -All needed files are stored in [artifacts subfolder](https://github.com/camaraproject/Commonalities/tree/API-linting-Implementation-Guideline/artifacts/linting_rules). - -The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. +This guide provides instructions on how to implement linting rules for the CAMARA APIs using two methods: +- [GitHub Actions](https://github.com/eric-murray/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#github-actions-integration) +- [Local Deployment](https://github.com/eric-murray/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) +Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](https://github.com/camaraproject/Commonalities/tree/main/artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. ## Spectral Configuration @@ -28,7 +28,7 @@ This file consolidates all rules: 2. Create **lint-function** folder - Make a folder named `lint_function` at root location and add custom [JavaScript function files](https://github.com/camaraproject/Commonalities/tree/API-linting-Implementation-Guideline/artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). + Make a folder named `lint_function` at root location and add custom [JavaScript function files](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). 3. Add **[spectral_oas_lint.yml](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.github/workflows/spectral_oas_lint.yml)** to GitHub action workflows in `.github/workflows` folder which includes the configuration of Spectral workflow for GitHub actions. @@ -51,11 +51,11 @@ The output from Spectral can be seen by expanding the step **Run Spectral Lintin [Megalinter](https://megalinter.io/latest/) is an Open-Source tool for CI/CD workflows that analyzes the consistency of code, configurations, and scripts in repository sources. Megalinter supports Spectral linting. The Megalinter job will be automatically activated once you submit a pull request on the [main/master] branch of the CAMARA repository, as configured in megalinter.yml. -The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. +The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. Additionally, Megalinter also supports linting of YAML files. To enable this, users need to add the following ruleset files to the root location. -- YAML Linting: .yamllint.yaml +- YAML Linting: .yamllint.yaml From 9c346024b6456abd9dba4e6fd3dadeeb3add9bb1 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 5 Aug 2024 14:43:02 +0100 Subject: [PATCH 2/9] Update API-linting-Implementation-Guideline.md --- documentation/API-linting-Implementation-Guideline.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index bbeebdb8..3b73e5e4 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -3,8 +3,8 @@ ## Introduction This guide provides instructions on how to implement linting rules for the CAMARA APIs using two methods: -- [GitHub Actions](https://github.com/eric-murray/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#github-actions-integration) -- [Local Deployment](https://github.com/eric-murray/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) +- [GitHub Actions](https://github.com/camaraproject/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#spectral-configuration) +- [Local Deployment](https://github.com/camaraproject/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](https://github.com/camaraproject/Commonalities/tree/main/artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. @@ -21,7 +21,6 @@ This file consolidates all rules: 2. Spectral rules with built-in functions 3. Spectral rules with custom JavaScript functions - ## GitHub Actions Integration 1. Add **[.spectral.yml](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.spectral.yml)** (rules) file to -> root location of repository @@ -45,7 +44,6 @@ Write access to the repository is required to perform these steps. The output from Spectral can be seen by expanding the step **Run Spectral Linting** of the given workflow run Actions section of GitHub repository. - ### Megalinter integration [Megalinter](https://megalinter.io/latest/) is an Open-Source tool for CI/CD workflows that analyzes the consistency of code, configurations, and scripts in repository sources. Megalinter supports Spectral linting. @@ -55,10 +53,7 @@ The Megalinter configuration consists of the .yamllint.yaml - - - +- YAML Linting: .yamllint.yaml ## API Linting configuration steps for local deployment From 1cd7d6c273404859df9acce9fcab16752d1a882e Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 5 Aug 2024 14:49:32 +0100 Subject: [PATCH 3/9] Update API-linting-Implementation-Guideline.md --- .../API-linting-Implementation-Guideline.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index 3b73e5e4..8d43d1e4 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -3,14 +3,14 @@ ## Introduction This guide provides instructions on how to implement linting rules for the CAMARA APIs using two methods: -- [GitHub Actions](https://github.com/camaraproject/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#spectral-configuration) -- [Local Deployment](https://github.com/camaraproject/Commonalities/blob/main/documentation/API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) +- [GitHub Actions](./API-linting-Implementation-Guideline.md#github-actions-integration) +- [Local Deployment](./API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) -Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](https://github.com/camaraproject/Commonalities/tree/main/artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. +Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](../artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. ## Spectral Configuration -The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) +The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) This file consolidates all rules: @@ -19,20 +19,20 @@ This file consolidates all rules: `Ruleset extension: extends: "spectral:oas"` 2. Spectral rules with built-in functions -3. Spectral rules with custom JavaScript functions +3. Spectral rules with custom JavaScript functions ## GitHub Actions Integration -1. Add **[.spectral.yml](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.spectral.yml)** (rules) file to -> root location of repository +1. Add **[.spectral.yml](../artifacts/linting_rules/.spectral.yml)** (rules) file to -> root location of repository 2. Create **lint-function** folder - Make a folder named `lint_function` at root location and add custom [JavaScript function files](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). + Make a folder named `lint_function` at root location and add custom [JavaScript function files](../artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). -3. Add **[spectral_oas_lint.yml](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.github/workflows/spectral_oas_lint.yml)** to GitHub action workflows in `.github/workflows` folder +3. Add **[spectral_oas_lint.yml](../artifacts/linting_rules/.github/workflows/spectral_oas_lint.yml)** to GitHub action workflows in `.github/workflows` folder which includes the configuration of Spectral workflow for GitHub actions. -4. Add [megalinter.yml](https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.github/workflows/megalinter.yml) to GitHub action workflows in `.github/workflows` folder +4. Add [megalinter.yml](../artifacts/linting_rules/.github/workflows/megalinter.yml) to GitHub action workflows in `.github/workflows` folder which includes the configuration of Megalinter and Spectral for GitHub actions. ### Manually running linting workflow @@ -49,11 +49,11 @@ The output from Spectral can be seen by expanding the step **Run Spectral Lintin [Megalinter](https://megalinter.io/latest/) is an Open-Source tool for CI/CD workflows that analyzes the consistency of code, configurations, and scripts in repository sources. Megalinter supports Spectral linting. The Megalinter job will be automatically activated once you submit a pull request on the [main/master] branch of the CAMARA repository, as configured in megalinter.yml. -The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. +The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. Additionally, Megalinter also supports linting of YAML files. To enable this, users need to add the following ruleset files to the root location. -- YAML Linting: .yamllint.yaml +- YAML Linting: .yamllint.yaml ## API Linting configuration steps for local deployment From 846e86e24de8acfb931f9d9a644e3ad5d1fe734c Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 5 Aug 2024 16:50:13 +0100 Subject: [PATCH 4/9] Update API-linting-Implementation-Guideline.md --- .../API-linting-Implementation-Guideline.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index 8d43d1e4..96e2aa69 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -3,14 +3,14 @@ ## Introduction This guide provides instructions on how to implement linting rules for the CAMARA APIs using two methods: -- [GitHub Actions](./API-linting-Implementation-Guideline.md#github-actions-integration) -- [Local Deployment](./API-linting-Implementation-Guideline.md#api-linting-configuration-steps-for-local-deployment) +- [GitHub Actions](#github-actions-integration) +- [Local Deployment](#api-linting-configuration-steps-for-local-deployment) -Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](../artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. +Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b261c3c-overview) tool. All needed files are stored in the [artifacts subfolder](/artifacts/linting_rules). The target method is linting rules integration with CAMARA API subproject repositories using GitHub Actions. ## Spectral Configuration -The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) +The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) This file consolidates all rules: @@ -19,20 +19,20 @@ This file consolidates all rules: `Ruleset extension: extends: "spectral:oas"` 2. Spectral rules with built-in functions -3. Spectral rules with custom JavaScript functions +3. Spectral rules with custom JavaScript functions ## GitHub Actions Integration -1. Add **[.spectral.yml](../artifacts/linting_rules/.spectral.yml)** (rules) file to -> root location of repository +1. Add **[.spectral.yml](/artifacts/linting_rules/.spectral.yml)** (rules) file to -> root location of repository 2. Create **lint-function** folder - Make a folder named `lint_function` at root location and add custom [JavaScript function files](../artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). + Make a folder named `lint_function` at root location and add custom [JavaScript function files](/artifacts/linting_rules/lint_function) that are imported in .spectral.yml (some rules require custom JavaScript functions to execute). -3. Add **[spectral_oas_lint.yml](../artifacts/linting_rules/.github/workflows/spectral_oas_lint.yml)** to GitHub action workflows in `.github/workflows` folder +3. Add **[spectral_oas_lint.yml](/artifacts/linting_rules/.github/workflows/spectral_oas_lint.yml)** to GitHub action workflows in `.github/workflows` folder which includes the configuration of Spectral workflow for GitHub actions. -4. Add [megalinter.yml](../artifacts/linting_rules/.github/workflows/megalinter.yml) to GitHub action workflows in `.github/workflows` folder +4. Add [megalinter.yml](/artifacts/linting_rules/.github/workflows/megalinter.yml) to GitHub action workflows in `.github/workflows` folder which includes the configuration of Megalinter and Spectral for GitHub actions. ### Manually running linting workflow @@ -49,11 +49,11 @@ The output from Spectral can be seen by expanding the step **Run Spectral Lintin [Megalinter](https://megalinter.io/latest/) is an Open-Source tool for CI/CD workflows that analyzes the consistency of code, configurations, and scripts in repository sources. Megalinter supports Spectral linting. The Megalinter job will be automatically activated once you submit a pull request on the [main/master] branch of the CAMARA repository, as configured in megalinter.yml. -The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. +The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. Additionally, Megalinter also supports linting of YAML files. To enable this, users need to add the following ruleset files to the root location. -- YAML Linting: .yamllint.yaml +- YAML Linting: .yamllint.yaml ## API Linting configuration steps for local deployment From 7fad4c8a2068f41c20357f6c1937717c0fcbcd1d Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Fri, 9 Aug 2024 16:23:56 +0100 Subject: [PATCH 5/9] Update documentation/API-linting-Implementation-Guideline.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Díez García --- documentation/API-linting-Implementation-Guideline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index 96e2aa69..e7479cee 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -10,7 +10,7 @@ Both methods use the [Spectral](https://docs.stoplight.io/docs/spectral/674b27b2 ## Spectral Configuration -The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) +The Spectral configuration consists of .spectral.yml file, which contains all the rules defined for CAMARA OpenAPI specification as described in [Linting-rules.md](Linting-rules.md) This file consolidates all rules: From 36a7b5128fc276fc928098a96f94505837873db2 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Fri, 9 Aug 2024 16:24:49 +0100 Subject: [PATCH 6/9] Update documentation/API-linting-Implementation-Guideline.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Díez García --- documentation/API-linting-Implementation-Guideline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index e7479cee..b026b5eb 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -49,7 +49,7 @@ The output from Spectral can be seen by expanding the step **Run Spectral Lintin [Megalinter](https://megalinter.io/latest/) is an Open-Source tool for CI/CD workflows that analyzes the consistency of code, configurations, and scripts in repository sources. Megalinter supports Spectral linting. The Megalinter job will be automatically activated once you submit a pull request on the [main/master] branch of the CAMARA repository, as configured in megalinter.yml. -The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. +The Megalinter configuration consists of the megalinter.yml file containing the necessary settings to run Megalinter and Spectral jobs on GitHub actions. Additionally, Megalinter also supports linting of YAML files. To enable this, users need to add the following ruleset files to the root location. From 10f19d87fceb426fa2499dbeb9199c7eeae34de9 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Fri, 9 Aug 2024 16:25:14 +0100 Subject: [PATCH 7/9] Update documentation/API-linting-Implementation-Guideline.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Díez García --- documentation/API-linting-Implementation-Guideline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index b026b5eb..2ea084fb 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -53,7 +53,7 @@ The Megalinter configuration consists of the .yamllint.yaml +- YAML Linting: .yamllint.yaml ## API Linting configuration steps for local deployment From 2404fc3b5c890398c5818e3a4b8d88dd60afa264 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Fri, 9 Aug 2024 16:25:35 +0100 Subject: [PATCH 8/9] Update documentation/API-linting-Implementation-Guideline.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pedro Díez García --- documentation/API-linting-Implementation-Guideline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index 2ea084fb..ee664b41 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -19,7 +19,7 @@ This file consolidates all rules: `Ruleset extension: extends: "spectral:oas"` 2. Spectral rules with built-in functions -3. Spectral rules with custom JavaScript functions +3. Spectral rules with customJavaScript functions ## GitHub Actions Integration From 9f555693de1ee3ca31647f7c2b7a18462b19e41c Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Fri, 9 Aug 2024 16:26:50 +0100 Subject: [PATCH 9/9] Update API-linting-Implementation-Guideline.md --- documentation/API-linting-Implementation-Guideline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/API-linting-Implementation-Guideline.md b/documentation/API-linting-Implementation-Guideline.md index ee664b41..442122c3 100644 --- a/documentation/API-linting-Implementation-Guideline.md +++ b/documentation/API-linting-Implementation-Guideline.md @@ -19,7 +19,7 @@ This file consolidates all rules: `Ruleset extension: extends: "spectral:oas"` 2. Spectral rules with built-in functions -3. Spectral rules with customJavaScript functions +3. Spectral rules with custom JavaScript functions ## GitHub Actions Integration