Skip to content

Commit e4dcfc6

Browse files
authored
Allow linking directly to each hook
1 parent 31853d6 commit e4dcfc6

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,81 +22,81 @@ Add this to your `.pre-commit-config.yaml`
2222

2323
### Hooks available
2424

25-
- `check-added-large-files` - Prevent giant files from being committed.
25+
- <a name="check-added-large-files">`check-added-large-files`</a> - Prevent giant files from being committed.
2626
- Specify what is "too large" with `args: ['--maxkb=123']` (default=500kB).
2727
- If `git-lfs` is installed, lfs files will be skipped
2828
(requires `git-lfs>=2.2.1`)
29-
- `check-ast` - Simply check whether files parse as valid python.
30-
- `check-builtin-literals` - Require literal syntax when initializing empty or zero Python builtin types.
29+
- <a name="check-ast">`check-ast`</a> - Simply check whether files parse as valid python.
30+
- <a name="check-builtin-literals">`check-builtin-literals`</a> - Require literal syntax when initializing empty or zero Python builtin types.
3131
- Allows calling constructors with positional arguments (e.g., `list('abc')`).
3232
- Allows calling constructors from the `builtins` (`__builtin__`) namespace (`builtins.list()`).
3333
- Ignore this requirement for specific builtin types with `--ignore=type1,type2,…`.
3434
- Forbid `dict` keyword syntax with `--no-allow-dict-kwargs`.
35-
- `check-byte-order-marker` - Forbid files which have a UTF-8 byte-order marker
36-
- `check-case-conflict` - Check for files with names that would conflict on a
35+
- <a name="check-byte-order-marker">`check-byte-order-marker`</a> - Forbid files which have a UTF-8 byte-order marker
36+
- <a name="check-case-conflict">`check-case-conflict`</a> - Check for files with names that would conflict on a
3737
case-insensitive filesystem like MacOS HFS+ or Windows FAT.
38-
- `check-docstring-first` - Checks for a common error of placing code before
38+
- <a name="check-docstring-first">`check-docstring-first`</a> - Checks for a common error of placing code before
3939
the docstring.
40-
- `check-executables-have-shebangs` - Checks that non-binary executables have a
40+
- <a name="check-executables-have-shebangs">`check-executables-have-shebangs`</a> - Checks that non-binary executables have a
4141
proper shebang.
42-
- `check-json` - Attempts to load all json files to verify syntax.
43-
- `check-merge-conflict` - Check for files that contain merge conflict strings.
44-
- `check-symlinks` - Checks for symlinks which do not point to anything.
45-
- `check-toml` - Attempts to load all TOML files to verify syntax.
46-
- `check-vcs-permalinks` - Ensures that links to vcs websites are permalinks.
47-
- `check-xml` - Attempts to load all xml files to verify syntax.
48-
- `check-yaml` - Attempts to load all yaml files to verify syntax.
42+
- <a name="check-json">`check-json`</a> - Attempts to load all json files to verify syntax.
43+
- <a name="check-merge-conflict">`check-merge-conflict`</a> - Check for files that contain merge conflict strings.
44+
- <a name="check-symlinks">`check-symlinks`</a> - Checks for symlinks which do not point to anything.
45+
- <a name="check-toml">`check-toml`</a> - Attempts to load all TOML files to verify syntax.
46+
- <a name="check-vcs-permalinks">`check-vcs-permalinks`</a> - Ensures that links to vcs websites are permalinks.
47+
- <a name="check-xml">`check-xml`</a> - Attempts to load all xml files to verify syntax.
48+
- <a name="check-yaml">`check-yaml`</a> - Attempts to load all yaml files to verify syntax.
4949
- `--allow-multiple-documents` - allow yaml files which use the
5050
[multi-document syntax](http://www.yaml.org/spec/1.2/spec.html#YAML)
5151
- `--unsafe` - Instead of loading the files, simply parse them for syntax.
5252
A syntax-only check enables extensions and unsafe constructs which would
5353
otherwise be forbidden. Using this option removes all guarantees of
5454
portability to other yaml implementations.
5555
Implies `--allow-multiple-documents`.
56-
- `debug-statements` - Check for debugger imports and py37+ `breakpoint()`
56+
- <a name="debug-statements">`debug-statements`</a> - Check for debugger imports and py37+ `breakpoint()`
5757
calls in python source.
58-
- `detect-aws-credentials` - Checks for the existence of AWS secrets that you
58+
- <a name="detect-aws-credentials">`detect-aws-credentials`</a> - Checks for the existence of AWS secrets that you
5959
have set up with the AWS CLI.
6060
The following arguments are available:
6161
- `--credentials-file CREDENTIALS_FILE` - additional AWS CLI style
6262
configuration file in a non-standard location to fetch configured
6363
credentials from. Can be repeated multiple times.
6464
- `--allow-missing-credentials` - Allow hook to pass when no credentials are
6565
detected.
66-
- `detect-private-key` - Checks for the existence of private keys.
67-
- `double-quote-string-fixer` - This hook replaces double quoted strings
66+
- <a name="detect-private-key">`detect-private-key`</a> - Checks for the existence of private keys.
67+
- <a name="double-quote-string-fixer">`double-quote-string-fixer`</a> - This hook replaces double quoted strings
6868
with single quoted strings.
69-
- `end-of-file-fixer` - Makes sure files end in a newline and only a newline.
70-
- `fix-encoding-pragma` - Add `# -*- coding: utf-8 -*-` to the top of python files.
69+
- <a name="end-of-file-fixer">`end-of-file-fixer`</a> - Makes sure files end in a newline and only a newline.
70+
- <a name="fix-encoding-pragma">`fix-encoding-pragma`</a> - Add `# -*- coding: utf-8 -*-` to the top of python files.
7171
- To remove the coding pragma pass `--remove` (useful in a python3-only codebase)
72-
- `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.
73-
- `flake8` - Run flake8 on your python files.
74-
- `forbid-new-submodules` - Prevent addition of new git submodules.
75-
- `mixed-line-ending` - Replaces or checks mixed line ending.
72+
- <a name="file-contents-sorter">`file-contents-sorter`</a> - 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.
73+
- <a name="flake8">`flake8`</a> - Run flake8 on your python files.
74+
- <a name="forbid-new-submodules">`forbid-new-submodules`</a> - Prevent addition of new git submodules.
75+
- <a name="mixed-line-ending">`mixed-line-ending`</a> - Replaces or checks mixed line ending.
7676
- `--fix={auto,crlf,lf,no}`
7777
- `auto` - Replaces automatically the most frequent line ending. This is the default argument.
7878
- `crlf`, `lf` - Forces to replace line ending by respectively CRLF and LF.
7979
- This option isn't compatible with git setup check-in LF check-out CRLF as git smudge this later than the hook is invoked.
8080
- `no` - Checks if there is any mixed line ending without modifying any file.
81-
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
81+
- <a name="name-tests-test">`name-tests-test`</a> - Assert that files in tests/ end in `_test.py`.
8282
- Use `args: ['--django']` to match `test*.py` instead.
83-
- `no-commit-to-branch` - Protect specific branches from direct checkins.
83+
- <a name="no-commit-to-branch">`no-commit-to-branch`</a> - Protect specific branches from direct checkins.
8484
- Use `args: [--branch, staging, --branch, master]` to set the branch.
8585
`master` is the default if no branch argument is set.
8686
- `-b` / `--branch` may be specified multiple times to protect multiple
8787
branches.
8888
- `-p` / `--pattern` can be used to protect branches that match a supplied regex
8989
(e.g. `--pattern, release/.*`). May be specified multiple times.
90-
- `pretty-format-json` - Checks that all your JSON files are pretty. "Pretty"
90+
- <a name="pretty-format-json">`pretty-format-json`</a> - Checks that all your JSON files are pretty. "Pretty"
9191
here means that keys are sorted and indented. You can configure this with
9292
the following commandline options:
9393
- `--autofix` - automatically format json files
9494
- `--indent ...` - Control the indentation (either a number for a number of spaces or a string of whitespace). Defaults to 4 spaces.
9595
- `--no-ensure-ascii` preserve unicode characters instead of converting to escape sequences
9696
- `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys)
9797
- `--top-keys comma,separated,keys` - Keys to keep at the top of mappings.
98-
- `requirements-txt-fixer` - Sorts entries in requirements.txt and removes incorrect entry for `pkg-resources==0.0.0`
99-
- `sort-simple-yaml` - Sorts simple YAML files which consist only of top-level
98+
- <a name="requirements-txt-fixer">`requirements-txt-fixer`</a> - Sorts entries in requirements.txt and removes incorrect entry for `pkg-resources==0.0.0`
99+
- <a name="sort-simple-yaml">`sort-simple-yaml`</a> - Sorts simple YAML files which consist only of top-level
100100
keys, preserving comments and blocks.
101101

102102
Note that `sort-simple-yaml` by default matches no `files` as it enforces a
@@ -108,7 +108,7 @@ Add this to your `.pre-commit-config.yaml`
108108
files: ^config/simple/
109109
```
110110
111-
- `trailing-whitespace` - Trims trailing whitespace.
111+
- <a name="trailing-whitespace">`trailing-whitespace`</a> - Trims trailing whitespace.
112112
- To preserve Markdown [hard linebreaks](https://github.github.com/gfm/#hard-line-break)
113113
use `args: [--markdown-linebreak-ext=md]` (or other extensions used
114114
by your markdownfiles). If for some reason you want to treat all files

0 commit comments

Comments
 (0)