Skip to content

Commit

Permalink
docs(git-hooks): add colors option for lefthook example 📝 (#876)
Browse files Browse the repository at this point in the history
Co-authored-by: torabit <[email protected]>
  • Loading branch information
torabit and torabit authored Aug 1, 2024
1 parent 2667903 commit d0ff7b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/content/docs/ja/recipes/git-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gitリポジトリのルートに`lefthook.yml`というファイルを追加し
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
```
- コミット前にformatチェックやlintを行い、[安全な修正](/ja/linter#安全な修正safe-fixes)を行う
Expand All @@ -34,7 +34,7 @@ Gitリポジトリのルートに`lefthook.yml`というファイルを追加し
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
```
Expand All @@ -47,7 +47,7 @@ Gitリポジトリのルートに`lefthook.yml`というファイルを追加し
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {push_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
```

`glob`と`--files-ignore-unknown=true` を併用する必要はありません。
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/pt-br/recipes/git-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Alguns exemplos de configurações:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
```
- Formatar, verificar erros e aplicar correções seguras antes de efetuar o commit.
Expand All @@ -35,7 +35,7 @@ Alguns exemplos de configurações:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
```
Expand All @@ -48,7 +48,7 @@ Alguns exemplos de configurações:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {push_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
```

Não é necessário utilizar tanto `glob` quanto `--files-ignore-unknown=true`.
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/recipes/git-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Some examples of _Lefthook_ configurations:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
```
- Format, lint, and apply safe code fixes before committing
Expand All @@ -34,7 +34,7 @@ Some examples of _Lefthook_ configurations:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
```
Expand All @@ -47,7 +47,7 @@ Some examples of _Lefthook_ configurations:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {push_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
```

Note that you don't need to use both `glob` and `--files-ignore-unknown=true`.
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/zh-cn/recipes/git-hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Git 允许在运行 git 命令的过程中执行 [Git Hooks](https://git-scm.com
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
```
- 提交前进行格式化,lint,以及进行安全的代码修复
Expand All @@ -34,7 +34,7 @@ Git 允许在运行 git 命令的过程中执行 [Git Hooks](https://git-scm.com
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
stage_fixed: true
```
Expand All @@ -47,7 +47,7 @@ Git 允许在运行 git 命令的过程中执行 [Git Hooks](https://git-scm.com
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true {push_files}
run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files}
```

注意你并不需要使用 `glob` 和 `--files-ignore-unknown=true` _Lefthook_。
Expand Down

0 comments on commit d0ff7b9

Please sign in to comment.