autohooks icon indicating copy to clipboard operation
autohooks copied to clipboard

Windows Problem

Open anujydv opened this issue 4 years ago • 2 comments

poetry run autohooks activate not working, giving KeyError PWD and after setting it manually, it's not performing any autohooks task as define in pyproject.toml.

anujydv avatar Oct 21 '20 16:10 anujydv

Could you please paste the full traceback? Without the traceback we can't debug this issue any further.

bjoernricks avatar Oct 22 '20 13:10 bjoernricks

Please check attached images MicrosoftTeams-image After setting it manually set PWD=<project_dir> hooks setup completed but 'git commit' not working.

anujydv avatar Oct 23 '20 04:10 anujydv

It seems below code is not for windows environment, I add another except for FileNotFoundError to let activiate passed, but when I commit code, pre-commit complaint python was not found.

def is_split_env():
    try:
        subprocess.run(
            shlex.split("/usr/bin/env -S echo True"),
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            universal_newlines=True,
            check=True,
        )
        is_split = True
    except subprocess.CalledProcessError:
        is_split = False
    except FileNotFoundError:
        is_split = False

    return is_split

an-li-the-dev avatar Oct 10 '22 01:10 an-li-the-dev

@An-Li-magicloud could you please create a new issue for your problem and provide a complete traceback? Your issue is completely unrelated. The original issue has been fixed with https://github.com/greenbone/autohooks/pull/165 already a long time ago.

bjoernricks avatar Oct 10 '22 08:10 bjoernricks