mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 03:56:54 +00:00
Add mixed-line-ending hook declaration
This commit is contained in:
parent
19377889df
commit
560e1c2e1b
4 changed files with 18 additions and 0 deletions
|
|
@ -123,6 +123,12 @@
|
||||||
entry: forbid-new-submodules
|
entry: forbid-new-submodules
|
||||||
description: Prevent addition of new git submodules
|
description: Prevent addition of new git submodules
|
||||||
files: ''
|
files: ''
|
||||||
|
- id: mixed-line-ending
|
||||||
|
name: Mixed line ending
|
||||||
|
language: python
|
||||||
|
entry: mixed-line-ending
|
||||||
|
description: Replaces or checks mixed line ending
|
||||||
|
files: ''
|
||||||
- id: name-tests-test
|
- id: name-tests-test
|
||||||
name: Tests should end in _test.py
|
name: Tests should end in _test.py
|
||||||
description: This verifies that test files are named correctly
|
description: This verifies that test files are named correctly
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@ Add this to your `.pre-commit-config.yaml`
|
||||||
- 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)
|
||||||
- `flake8` - Run flake8 on your python files.
|
- `flake8` - Run flake8 on your python files.
|
||||||
- `forbid-new-submodules` - Prevent addition of new git submodules.
|
- `forbid-new-submodules` - Prevent addition of new git submodules.
|
||||||
|
- `mixed-line-ending` - Replaces or checks mixed line ending.
|
||||||
|
- `--fix={auto,crlf,lf,no}`
|
||||||
|
- `auto` - Replace automatically the most frequent line ending.
|
||||||
|
- `crlf`, `lf` - Force to replace line ending by respectively CRLF and LF.
|
||||||
|
- `no` - Checks if there is any mixed line ending.
|
||||||
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
|
- `name-tests-test` - Assert that files in tests/ end in `_test.py`.
|
||||||
- Use `args: ['--django']` to match `test*.py` instead.
|
- Use `args: ['--django']` to match `test*.py` instead.
|
||||||
- `no-commit-to-branch` - Protect specific branches from direct checkins.
|
- `no-commit-to-branch` - Protect specific branches from direct checkins.
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,12 @@
|
||||||
entry: forbid-new-submodules
|
entry: forbid-new-submodules
|
||||||
description: Prevent addition of new git submodules
|
description: Prevent addition of new git submodules
|
||||||
files: ''
|
files: ''
|
||||||
|
- id: mixed-line-ending
|
||||||
|
name: Mixed line ending
|
||||||
|
language: python
|
||||||
|
entry: mixed-line-ending
|
||||||
|
description: Replaces or checks mixed line ending
|
||||||
|
files: ''
|
||||||
- id: name-tests-test
|
- id: name-tests-test
|
||||||
name: Tests should end in _test.py
|
name: Tests should end in _test.py
|
||||||
description: This verifies that test files are named correctly
|
description: This verifies that test files are named correctly
|
||||||
|
|
|
||||||
1
setup.py
1
setup.py
|
|
@ -51,6 +51,7 @@ setup(
|
||||||
'end-of-file-fixer = pre_commit_hooks.end_of_file_fixer:end_of_file_fixer',
|
'end-of-file-fixer = pre_commit_hooks.end_of_file_fixer:end_of_file_fixer',
|
||||||
'fix-encoding-pragma = pre_commit_hooks.fix_encoding_pragma:main',
|
'fix-encoding-pragma = pre_commit_hooks.fix_encoding_pragma:main',
|
||||||
'forbid-new-submodules = pre_commit_hooks.forbid_new_submodules:main',
|
'forbid-new-submodules = pre_commit_hooks.forbid_new_submodules:main',
|
||||||
|
'mixed-line-ending = pre_commit_hooks.mixed_line_ending:mixed_line_ending',
|
||||||
'name-tests-test = pre_commit_hooks.tests_should_end_in_test:validate_files',
|
'name-tests-test = pre_commit_hooks.tests_should_end_in_test:validate_files',
|
||||||
'no-commit-to-branch = pre_commit_hooks.no_commit_to_branch:main',
|
'no-commit-to-branch = pre_commit_hooks.no_commit_to_branch:main',
|
||||||
'pretty-format-json = pre_commit_hooks.pretty_format_json:pretty_format_json',
|
'pretty-format-json = pre_commit_hooks.pretty_format_json:pretty_format_json',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue