-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: update custom linting doc [INS-3273] * update git commit example img
- Loading branch information
Showing
7 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions
32
docs/inso-cli/cli-command-reference/inso-custom-linting.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
layout: article-detail | ||
title: Using Custom Linting with Inso CLI | ||
category: "Using Custom Linting with Inso CLI" | ||
category-url: inso-custom-linting | ||
--- | ||
|
||
This tutorial will guide you through the process of implementing custom linting for your OpenAPI Specification (OAS) files using Inso CLI and Insomnia. Custom linting allows you to apply specific rules that suit your project's requirements, ensuring your API specifications maintain high quality and consistency. | ||
|
||
### Step 1: Create Your Custom Spectral Ruleset File | ||
|
||
First, you need to create a Spectral ruleset file. This file can be in YAML, YML, JSON, or JS format. For example, create a file named `.spectral.yml` and define your custom rules in it. | ||
|
||
### Step 2: Place the Ruleset File in the Correct Directory | ||
|
||
Place your `.spectral.(yaml|yml|json|js)` file in the same directory as your OAS file (`oas.yaml`). | ||
|
||
### Step 3: Run Inso CLI Lint Command | ||
|
||
Open your terminal and navigate to the directory containing your OAS file and the custom Spectral ruleset file. Run the following command: | ||
|
||
```bash | ||
inso lint spec ./oas.yaml | ||
``` | ||
|
||
The Inso CLI will automatically detect the `.spectral` file in the directory and use it to lint your `oas.yaml` file according to the custom rules you've defined. | ||
|
||
### Step 4: Review the Output | ||
|
||
Inspect the output in your terminal. It will display any issues found based on your custom linting rules. Make necessary adjustments to your OAS file based on these results. | ||
|
||
> For custom linting on Insomnia refer to [this document](https://docs.insomnia.rest/insomnia/linting#custom-linting). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3eceaef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
insomnia-docs – ./
insomnia-docs-git-main-green-rs.vercel.app
insomnia-docs-three.vercel.app
insomnia-docs-green-rs.vercel.app