Skip to content

Commit

Permalink
docs(website): translate integrate-biome-with-your-vcs into Japanese (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
unvalley committed Mar 25, 2024
1 parent 98d1518 commit bb59e3c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
1 change: 1 addition & 0 deletions website/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default defineConfig({
label: "Integrate Biome with your VCS",
link: "/guides/integrate-in-vcs",
translations: {
ja: "Biome をあなたの VCS と統合する",
"zh-CN": "与版本控制系统集成",
"pt-BR": "Integrando o Biome com o seu VCS",
},
Expand Down
2 changes: 1 addition & 1 deletion website/src/content/docs/guides/integrate-in-vcs.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Integrate Biome with your VCS
description: Learn how Biome works, like assumptions, configuration and more.
description: Learn how you can integrate Biome with VCS
---

The VCS (Version Control System) integration is meant to take advantage of **additional** features that only a VCS can provide, allowing to customise
Expand Down
66 changes: 66 additions & 0 deletions website/src/content/docs/ja/guides/integrate-in-vcs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: Biome をあなたの VCS と統合する
description: Biome を VCS と統合する方法を学びます
---

VCS (バージョン管理システム)の統合は、追加の機能を活用することを目的としており、VCSでしか提供できない機能を利用して開発体験をさらにカスタマイズできるようになります。

この統合は *opt-in* であり、2つの必須フィールドが必要です。`vcs.enabled` フィールドと `vcs.clientKind` フィールドです。

```json title="biome.json"
{
"vcs": {
"enabled": true,
"clientKind": "git"
}
}
```

この設定自体は、**何も行いません**。新機能を opt-in する必要があります。

### 無視するファイルを設定する

この機能では、Biome が VCS において、指定されたすべてのファイルとフォルダを無視することができます。これは opt-in 機能であり、`vcs.useIgnoreFile` フィールドを有効にする必要があります。

```json title="biome.json" ins={5}
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
```

### 変更されたファイルのみを処理する

この機能は CLI でのみ利用可能で、特定のリビジョン間で**変更されたファイルのみ**を処理できます。

設定ファイルを更新し、`vcs.defaultBranch` フィールドでデフォルトのブランチを Biome に伝える必要があります。

```json title="biome.json" ins={6}
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
}
}
```

次に、コマンドに `--changed` オプションを追加すると、VCS が"変更された"と認識したファイルのみを処理します。Biome は、VCS の助けを借りて、main ブランチと現在のリビジョンからの変更ファイルを判断します。

```shell
biome format --changed
```

:::caution
Biomeは何が変更されたかをチェックしません。つまり、スペースや改行を追加しただけでもファイルが"変更された"とマークされます。
:::

あるいは、`--since` オプションを使って任意のブランチを指定することもできます。このオプションは `vcs.defaultBranch` オプションよりも**優先**されます。例えば、変更を next ブランチと比較したい場合は次のようにします。

```shell
biome format --changed --since=next
```

0 comments on commit bb59e3c

Please sign in to comment.