Skip to content

Commit 8fe064d

Browse files
authored
Alphabetize & clarify file-contents-sorter in README
1 parent 6b03546 commit 8fe064d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,24 @@ This hook replaces double quoted strings with single quoted strings.
114114
#### `end-of-file-fixer`
115115
Makes sure files end in a newline and only a newline.
116116

117+
#### `file-contents-sorter`
118+
Sort the lines in specified files (defaults to alphabetical).
119+
You must provide the target [`files`](https://pre-commit.com/#config-files) as input, for example:
120+
121+
```yaml
122+
- id: file-contents-sorter
123+
files: \.gitignore
124+
```
125+
126+
Note that this hook WILL remove blank lines and does NOT respect any comments.
127+
117128
#### `fix-byte-order-marker`
118129
removes UTF-8 byte order marker
119130

120131
#### `fix-encoding-pragma`
121132
Add `# -*- coding: utf-8 -*-` to the top of python files.
122133
- To remove the coding pragma pass `--remove` (useful in a python3-only codebase)
123134

124-
#### `file-contents-sorter`
125-
Sort the lines in specified files (defaults to alphabetical).
126-
You must provide list of target files as input to it.
127-
Note that this hook WILL remove blank lines and does NOT respect any comments.
128-
129135
The following arguments are available:
130136
- `--ignore-case` - fold lower case to upper case characters.
131137
- `--unique` - ensure each line is unique.

0 commit comments

Comments
 (0)