Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): add IDE document #390

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]

- uses: actions-rs/toolchain@v1

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]

- uses: actions-rs/toolchain@v1

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[actionlint] reported by reviewdog 🐶
the runner of "actions-rs/toolchain@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue [action]

- uses: actions-rs/toolchain@v1

Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: schema.json
path: schema/schema.json
path: schema.json
if-no-files-found: error

web:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ Cargo.lock
commitlint

# Commitlint config file
.commitlintrc
.commitlintrc.*

# JSON schema
schema.json
2 changes: 1 addition & 1 deletion cli/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn extract_commit_messages(input: &str) -> Vec<String> {
/// Please refer the official documentation for the commit message format.
/// See: https://www.conventionalcommits.org/en/v1.0.0/#summary
///
/// ```
/// ```ignore
/// <type>[optional scope]: <description> <-- Subject
///
/// [optional body] <-- Body
Expand Down
83 changes: 83 additions & 0 deletions web/src/content/docs/config/IDE.md
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:
```
Loading