mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-08 04:34:16 +00:00
Alphabetize & clarify file-contents-sorter in README
This commit is contained in:
parent
6b03546fc3
commit
8fe064d0bd
1 changed files with 11 additions and 5 deletions
16
README.md
16
README.md
|
|
@ -114,6 +114,17 @@ This hook replaces double quoted strings with single quoted strings.
|
||||||
#### `end-of-file-fixer`
|
#### `end-of-file-fixer`
|
||||||
Makes sure files end in a newline and only a newline.
|
Makes sure files end in a newline and only a newline.
|
||||||
|
|
||||||
|
#### `file-contents-sorter`
|
||||||
|
Sort the lines in specified files (defaults to alphabetical).
|
||||||
|
You must provide the target [`files`](https://pre-commit.com/#config-files) as input, for example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- id: file-contents-sorter
|
||||||
|
files: \.gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that this hook WILL remove blank lines and does NOT respect any comments.
|
||||||
|
|
||||||
#### `fix-byte-order-marker`
|
#### `fix-byte-order-marker`
|
||||||
removes UTF-8 byte order marker
|
removes UTF-8 byte order marker
|
||||||
|
|
||||||
|
|
@ -121,11 +132,6 @@ removes UTF-8 byte order marker
|
||||||
Add `# -*- coding: utf-8 -*-` to the top of python files.
|
Add `# -*- coding: utf-8 -*-` to the top of python files.
|
||||||
- To remove the coding pragma pass `--remove` (useful in a python3-only codebase)
|
- To remove the coding pragma pass `--remove` (useful in a python3-only codebase)
|
||||||
|
|
||||||
#### `file-contents-sorter`
|
|
||||||
Sort the lines in specified files (defaults to alphabetical).
|
|
||||||
You must provide list of target files as input to it.
|
|
||||||
Note that this hook WILL remove blank lines and does NOT respect any comments.
|
|
||||||
|
|
||||||
The following arguments are available:
|
The following arguments are available:
|
||||||
- `--ignore-case` - fold lower case to upper case characters.
|
- `--ignore-case` - fold lower case to upper case characters.
|
||||||
- `--unique` - ensure each line is unique.
|
- `--unique` - ensure each line is unique.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue