Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Unable to use checkmake hook #2

Closed
@colindean

Description

@colindean

I've placed this in my pre-commit configuration:

  - repo: https://github.com/Lucas-C/pre-commit-hooks-go
    rev: v1.0.1
    hooks:
      - id: checkmake

It errors when setting up.

pre-commit log output:

version information

pre-commit version: 2.18.1
git --version: git version 2.36.0
sys.version:
    3.10.2 (main, Feb  2 2022, 05:51:25) [Clang 13.0.0 (clang-1300.0.29.3)]
sys.executable: /opt/homebrew/Cellar/pre-commit/2.18.1/libexec/bin/python3
os.name: posix
sys.platform: darwin

error information

An unexpected error has occurred: CalledProcessError: command: ('/opt/homebrew/bin/go', 'install', './...')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    pattern ./...: directory prefix . does not contain main module or its selected dependencies
    
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/error_handler.py", line 73, in error_handler
    yield
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/main.py", line 343, in main
    return hook_impl(
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/commands/hook_impl.py", line 237, in hook_impl
    return retv | run(config, store, ns)
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/commands/run.py", line 414, in run
    install_hook_envs(to_install, store)
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/repository.py", line 221, in install_hook_envs
    _hook_install(hook)
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/repository.py", line 79, in _hook_install
    lang.install_environment(
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/languages/golang.py", line 83, in install_environment
    cmd_output_b('go', 'install', './...', cwd=repo_src_dir, env=env)
  File "/opt/homebrew/Cellar/pre-commit/2.18.1/libexec/lib/python3.10/site-packages/pre_commit/util.py", line 146, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/opt/homebrew/bin/go', 'install', './...')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    pattern ./...: directory prefix . does not contain main module or its selected dependencies

I speculate that this might be a pre-commit problem and not this specific checkmake hook's problem. It seems like how pre-commit is invoking go install may be nonsensical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions