-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add IDE document Signed-off-by: KeisukeYamashita <[email protected]> * fix(cli): remove doctest from parse_commit_message example Signed-off-by: KeisukeYamashita <[email protected]> --------- Signed-off-by: KeisukeYamashita <[email protected]>
- Loading branch information
1 parent
91bd0a7
commit 1564290
Showing
4 changed files
with
89 additions
and
2 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
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 |
---|---|---|
|
@@ -20,4 +20,8 @@ Cargo.lock | |
commitlint | ||
|
||
# Commitlint config file | ||
.commitlintrc | ||
.commitlintrc.* | ||
|
||
# JSON schema | ||
schema.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: IDE | ||
description: Guide how to setup your IDE to work with commitlint | ||
--- | ||
|
||
Commitlint offers schema by supporting [JSON schema](https://json-schema.org/) so that you can configure your IDE to work with Commitlint and have better developer experience. | ||
|
||
:::tip | ||
|
||
If you want to pin the schema to a specific version, you can configure the version in the URL. | ||
|
||
```console | ||
https://github.com/KeisukeYamashita/commitlint-rs/releases/download/v0.2.0/schema.json | ||
``` | ||
|
||
In this case, the schema is pinned to version `0.2.0`. | ||
|
||
::: | ||
|
||
## Visual Studio Code | ||
|
||
Configure your [Visual Studio Code](https://code.visualstudio.com/) to work with Commitlint. | ||
|
||
### Edit in `settings.json` | ||
|
||
Update your user `settings.json` or workspace settings (`/.vscode/settings.json`) to configure the schema. | ||
|
||
#### JSON | ||
|
||
```json | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": [ | ||
".commitlintrc", | ||
".commitlintrc.json" | ||
], | ||
"url": "https://github.com/KeisukeYamashita/commitlint-rs/releases/latest/download/schema.json" | ||
} | ||
] | ||
``` | ||
|
||
#### YAML | ||
|
||
Associating schemas with YAMLs are supported by the [YAML language server](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). | ||
|
||
```json | ||
"yaml.schemas": { | ||
"https://github.com/KeisukeYamashita/commitlint-rs/releases/latest/download/schema.json": [ | ||
".commitlintrc", | ||
".commitlintrc.yaml", | ||
".commitlint.yml" | ||
] | ||
} | ||
``` | ||
|
||
### Specify schema in the configuration file | ||
|
||
```json | ||
{ | ||
"$schema": "https://github.com/KeisukeYamashita/commitlint-rs/releases/download/v0.2.0/schema.json", | ||
"rules": {} | ||
} | ||
``` | ||
|
||
#### JSON | ||
|
||
Add the following comment in your `.commitlintrc` or `.commitlintrc.json` file. | ||
|
||
```json | ||
{ | ||
"$schema": "https://github.com/KeisukeYamashita/commitlint-rs/releases/latest/download/schema.json", | ||
"rules": {} | ||
} | ||
``` | ||
|
||
#### YAML | ||
|
||
Associating schemas with YAMLs are supported by the [YAML language server](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). Add the following comment in your `.commitlintrc`, `.commitlintrc.yaml` or `.commitlintrc.yml` file. | ||
|
||
```yaml | ||
# yaml-language-server: $schema=https://github.com/KeisukeYamashita/commitlint-rs/releases/latest/download/schema.json | ||
rules: | ||
``` |