See https://github.com/pre-commit/pre-commit/issues/354
()
| 208 | |
| 209 | |
| 210 | def check_for_cygwin_mismatch() -> None: |
| 211 | """See https://github.com/pre-commit/pre-commit/issues/354""" |
| 212 | if sys.platform in ('cygwin', 'win32'): # pragma: no cover (windows) |
| 213 | is_cygwin_python = sys.platform == 'cygwin' |
| 214 | try: |
| 215 | toplevel = get_root() |
| 216 | except FatalError: # skip the check if we're not in a git repo |
| 217 | return |
| 218 | is_cygwin_git = toplevel.startswith('/') |
| 219 | |
| 220 | if is_cygwin_python ^ is_cygwin_git: |
| 221 | exe_type = {True: '(cygwin)', False: '(windows)'} |
| 222 | logger.warning( |
| 223 | f'pre-commit has detected a mix of cygwin python / git\n' |
| 224 | f'This combination is not supported, it is likely you will ' |
| 225 | f'receive an error later in the program.\n' |
| 226 | f'Make sure to use cygwin git+python while using cygwin\n' |
| 227 | f'These can be installed through the cygwin installer.\n' |
| 228 | f' - python {exe_type[is_cygwin_python]}\n' |
| 229 | f' - git {exe_type[is_cygwin_git]}\n', |
| 230 | ) |
| 231 | |
| 232 | |
| 233 | def get_best_candidate_tag(rev: str, git_repo: str) -> str: |
nothing calls this directly
no test coverage detected