Skip to content

Commit d2a2cde

Browse files
committed
Add note about sort-simple-yaml's opt-in behaviour
1 parent 8884b63 commit d2a2cde

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,18 @@ Add this to your `.pre-commit-config.yaml`
9494
- `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys)
9595
- `--top-keys comma,separated,keys` - Keys to keep at the top of mappings.
9696
- `requirements-txt-fixer` - Sorts entries in requirements.txt and removes incorrect entry for `pkg-resources==0.0.0`
97-
- `sort-simple-yaml` - Sorts simple YAML files which consist only of top-level keys, preserving comments and blocks.
97+
- `sort-simple-yaml` - Sorts simple YAML files which consist only of top-level
98+
keys, preserving comments and blocks.
99+
100+
Note that `sort-simple-yaml` by default matches no `files` as it enforces a
101+
very specific format. You must opt in to this by setting `files`, for
102+
example:
103+
104+
```yaml
105+
- id: sort-simple-yaml
106+
files: ^config/simple/
107+
```
108+
98109
- `trailing-whitespace` - Trims trailing whitespace.
99110
- To preserve Markdown [hard linebreaks](https://github.github.com/gfm/#hard-line-break)
100111
use `args: [--markdown-linebreak-ext=md]` (or other extensions used

0 commit comments

Comments
 (0)