We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e71fd49 + 2468167 commit fe1db5fCopy full SHA for fe1db5f
pre_commit_hooks/check_case_conflict.py
@@ -1,5 +1,4 @@
1
import argparse
2
-import os.path
3
from typing import Iterable
4
from typing import Iterator
5
from typing import Optional
@@ -15,10 +14,11 @@ def lower_set(iterable: Iterable[str]) -> Set[str]:
15
14
16
17
def parents(file: str) -> Iterator[str]:
18
- file = os.path.dirname(file)
19
- while file:
20
- yield file
21
+ path_parts = file.split('/')
+ path_parts.pop()
+ while path_parts:
+ yield '/'.join(path_parts)
22
23
24
def directories_for(files: Set[str]) -> Set[str]:
0 commit comments