mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 04:54:16 +00:00
Merge pull request #476 from pre-commit/remove_flake8
remove flake8 and suggest pycqa/flake8
This commit is contained in:
commit
b3f3c34516
6 changed files with 41 additions and 28 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
- id: autopep8-wrapper
|
- id: autopep8-wrapper
|
||||||
name: autopep8 wrapper
|
name: autopep8 wrapper
|
||||||
description: This is deprecated, use pre-commit/mirrors-autopep8 instead.
|
description: This is deprecated, use pre-commit/mirrors-autopep8 instead.
|
||||||
entry: autopep8-wrapper
|
entry: pre-commit-hooks-removed autopep8-wrapper autopep8 https://github.com/pre-commit/mirrors-autopep8
|
||||||
language: python
|
language: python
|
||||||
types: [python]
|
always_run: true
|
||||||
args: [-i]
|
pass_filenames: false
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
name: Check for added large files
|
name: Check for added large files
|
||||||
description: Prevent giant files from being committed
|
description: Prevent giant files from being committed
|
||||||
|
|
@ -140,10 +140,10 @@
|
||||||
- id: flake8
|
- id: flake8
|
||||||
name: Flake8 (deprecated, use gitlab.com/pycqa/flake8)
|
name: Flake8 (deprecated, use gitlab.com/pycqa/flake8)
|
||||||
description: This hook runs flake8. (deprecated, use gitlab.com/pycqa/flake8)
|
description: This hook runs flake8. (deprecated, use gitlab.com/pycqa/flake8)
|
||||||
entry: flake8
|
entry: pre-commit-hooks-removed flake8 flake8 https://gitlab.com/pycqa/flake8
|
||||||
language: python
|
language: python
|
||||||
types: [python]
|
always_run: true
|
||||||
require_serial: true
|
pass_filenames: false
|
||||||
- id: forbid-new-submodules
|
- id: forbid-new-submodules
|
||||||
name: Forbid new submodules
|
name: Forbid new submodules
|
||||||
language: python
|
language: python
|
||||||
|
|
@ -170,9 +170,10 @@
|
||||||
- id: pyflakes
|
- id: pyflakes
|
||||||
name: Pyflakes (DEPRECATED, use flake8)
|
name: Pyflakes (DEPRECATED, use flake8)
|
||||||
description: This hook runs pyflakes. (This is deprecated, use flake8).
|
description: This hook runs pyflakes. (This is deprecated, use flake8).
|
||||||
entry: pyflakes
|
entry: pre-commit-hooks-removed pyflakes flake8 https://gitlab.com/pycqa/flake8
|
||||||
language: python
|
language: python
|
||||||
types: [python]
|
always_run: true
|
||||||
|
pass_filenames: false
|
||||||
- id: requirements-txt-fixer
|
- id: requirements-txt-fixer
|
||||||
name: Fix requirements.txt
|
name: Fix requirements.txt
|
||||||
description: Sorts entries in requirements.txt
|
description: Sorts entries in requirements.txt
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
def main() -> int:
|
|
||||||
raise SystemExit(
|
|
||||||
'autopep8-wrapper is deprecated. Instead use autopep8 directly via '
|
|
||||||
'https://github.com/pre-commit/mirrors-autopep8',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
exit(main())
|
|
||||||
15
pre_commit_hooks/removed.py
Normal file
15
pre_commit_hooks/removed.py
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import sys
|
||||||
|
from typing import Optional
|
||||||
|
from typing import Sequence
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv: Optional[Sequence[str]] = None) -> int:
|
||||||
|
argv = argv if argv is not None else sys.argv[1:]
|
||||||
|
hookid, new_hookid, url = argv
|
||||||
|
raise SystemExit(
|
||||||
|
f'`{hookid}` has been removed -- use `{new_hookid}` from {url}',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
exit(main())
|
||||||
|
|
@ -29,7 +29,6 @@ python_requires = >=3.6.1
|
||||||
|
|
||||||
[options.entry_points]
|
[options.entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
autopep8-wrapper = pre_commit_hooks.autopep8_wrapper:main
|
|
||||||
check-added-large-files = pre_commit_hooks.check_added_large_files:main
|
check-added-large-files = pre_commit_hooks.check_added_large_files:main
|
||||||
check-ast = pre_commit_hooks.check_ast:main
|
check-ast = pre_commit_hooks.check_ast:main
|
||||||
check-builtin-literals = pre_commit_hooks.check_builtin_literals:main
|
check-builtin-literals = pre_commit_hooks.check_builtin_literals:main
|
||||||
|
|
@ -55,6 +54,7 @@ console_scripts =
|
||||||
mixed-line-ending = pre_commit_hooks.mixed_line_ending:main
|
mixed-line-ending = pre_commit_hooks.mixed_line_ending:main
|
||||||
name-tests-test = pre_commit_hooks.tests_should_end_in_test:main
|
name-tests-test = pre_commit_hooks.tests_should_end_in_test:main
|
||||||
no-commit-to-branch = pre_commit_hooks.no_commit_to_branch:main
|
no-commit-to-branch = pre_commit_hooks.no_commit_to_branch:main
|
||||||
|
pre-commit-hooks-removed = pre_commit_hooks.removed:main
|
||||||
pretty-format-json = pre_commit_hooks.pretty_format_json:main
|
pretty-format-json = pre_commit_hooks.pretty_format_json:main
|
||||||
requirements-txt-fixer = pre_commit_hooks.requirements_txt_fixer:main
|
requirements-txt-fixer = pre_commit_hooks.requirements_txt_fixer:main
|
||||||
sort-simple-yaml = pre_commit_hooks.sort_simple_yaml:main
|
sort-simple-yaml = pre_commit_hooks.sort_simple_yaml:main
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
import pytest
|
|
||||||
|
|
||||||
from pre_commit_hooks.autopep8_wrapper import main
|
|
||||||
|
|
||||||
|
|
||||||
def test_invariantly_fails():
|
|
||||||
with pytest.raises(SystemExit) as excinfo:
|
|
||||||
main()
|
|
||||||
msg, = excinfo.value.args
|
|
||||||
assert 'https://github.com/pre-commit/mirrors-autopep8' in msg
|
|
||||||
16
tests/removed_test.py
Normal file
16
tests/removed_test.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from pre_commit_hooks.removed import main
|
||||||
|
|
||||||
|
|
||||||
|
def test_always_fails():
|
||||||
|
with pytest.raises(SystemExit) as excinfo:
|
||||||
|
main((
|
||||||
|
'autopep8-wrapper', 'autopep8',
|
||||||
|
'https://github.com/pre-commit/mirrors-autopep8',
|
||||||
|
))
|
||||||
|
msg, = excinfo.value.args
|
||||||
|
assert msg == (
|
||||||
|
'`autopep8-wrapper` has been removed -- '
|
||||||
|
'use `autopep8` from https://github.com/pre-commit/mirrors-autopep8'
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue