Skip to content

Commit b516d66

Browse files
authored
Update quick start to use prek.toml (#1576)
1 parent 60eb3f4 commit b516d66

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

docs/quickstart.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,25 @@ Follow this short example to experience how prek automates linting and formattin
3737

3838
### 1. Create a configuration
3939

40-
In the root of your repository, add a `.pre-commit-config.yaml`:
41-
42-
```yaml
43-
repos:
44-
- repo: https://github.com/pre-commit/pre-commit-hooks
45-
rev: v6.0.0
46-
hooks:
47-
- id: check-yaml
48-
- id: end-of-file-fixer
40+
In the root of your repository, add a `prek.toml`:
41+
42+
```toml
43+
[[repos]]
44+
repo = "https://github.com/pre-commit/pre-commit-hooks"
45+
rev = "v6.0.0"
46+
hooks = [
47+
{ id = "check-yaml" },
48+
{ id = "end-of-file-fixer" },
49+
]
4950
```
5051

51-
This configuration uses the `pre-commit-hooks` repository and enables two hooks: one validates YAML files, and the other ensures every file ends with a newline.
52+
This configuration uses the `pre-commit-hooks` repository and enables two hooks: `check-yaml` validates YAML files, and `end-of-file-fixer` ensures every file ends with a newline.
5253

5354
!!! note
5455

55-
`.pre-commit-config.yaml` is the configuration file name used by **pre-commit**, a widely-used git hook manager. prek reads the same configuration file today. In the future, prek might introduce its own configuration file.
56+
`prek.toml` is the native configuration file for **prek**. If you already have a `.pre-commit-config.yaml`, prek can still read it today.
5657

57-
Once you’re happy with your setup, you can stage the config file with `git add .pre-commit-config.yaml`.
58+
Once you’re happy with your setup, you can stage the config file with `git add prek.toml`.
5859

5960
### 2. Run hooks on demand
6061

0 commit comments

Comments
 (0)