File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1515 rev : 3.7.9
1616 hooks :
1717 - id : flake8
18+ additional_dependencies : [flake8-typing-imports==1.5.0]
1819- repo : https://github.com/pre-commit/mirrors-autopep8
1920 rev : v1.4.4
2021 hooks :
Original file line number Diff line number Diff line change 33import random
44from typing import Any
55from typing import List
6- from typing import NoReturn
76from typing import Optional
87from typing import overload
98from typing import Sequence
109from typing import Tuple
10+ from typing import TYPE_CHECKING
1111
1212import pre_commit .constants as C
1313from pre_commit .hook import Hook
1414from pre_commit .prefix import Prefix
1515from pre_commit .util import cmd_output_b
1616from pre_commit .xargs import xargs
1717
18+ if TYPE_CHECKING :
19+ from typing import NoReturn
20+
1821FIXED_RANDOM_SEED = 1542676186
1922
2023
@@ -65,7 +68,7 @@ def no_install(
6568 prefix : Prefix ,
6669 version : str ,
6770 additional_dependencies : Sequence [str ],
68- ) -> NoReturn :
71+ ) -> ' NoReturn' :
6972 raise AssertionError ('This type is not installable' )
7073
7174
Original file line number Diff line number Diff line change 11import os .path
22from typing import Mapping
3- from typing import NoReturn
43from typing import Optional
54from typing import Tuple
5+ from typing import TYPE_CHECKING
66
77from identify .identify import parse_shebang_from_file
88
9+ if TYPE_CHECKING :
10+ from typing import NoReturn
11+
912
1013class ExecutableNotFoundError (OSError ):
1114 def to_output (self ) -> Tuple [int , bytes , None ]:
@@ -44,7 +47,7 @@ def find_executable(
4447
4548
4649def normexe (orig : str ) -> str :
47- def _error (msg : str ) -> NoReturn :
50+ def _error (msg : str ) -> ' NoReturn' :
4851 raise ExecutableNotFoundError (f'Executable `{ orig } ` { msg } ' )
4952
5053 if os .sep not in orig and (not os .altsep or os .altsep not in orig ):
You can’t perform that action at this time.
0 commit comments