Skip to content

rbenv FileNotFoundError when installing markdownlint hook #1658

@adithyabsk

Description

@adithyabsk

I am trying to use https://github.com/markdownlint/markdownlint to lint my markdown files. I checked the issue tracker and don't seem to see any related issues.

I have .rbenv installed on my system and am wondering if that could be interfering with pre-commit?

.pre-commit-config.yaml

repos:
-   repo: https://github.com/markdownlint/markdownlint
    rev: master
    hooks:
    -   id: markdownlint

version information

pre-commit version: 2.7.1
sys.version:
    3.9.0 (default, Oct  9 2020, 16:41:50) 
    [Clang 12.0.0 (clang-1200.0.32.2)]
sys.executable: /usr/local/Cellar/pre-commit/2.7.1_1/libexec/bin/python
os.name: posix
sys.platform: darwin

error information

An unexpected error has occurred: FileNotFoundError: [Errno 2] No such file or directory: '/Users/adithyabalaji/.cache/pre-commit/repo09b5y8iv/rbenv-system/.install_state_v1staging'
Traceback (most recent call last):
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/error_handler.py", line 63, in error_handler
    yield
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/main.py", line 390, in main
    return run(args.config, store, args)
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/commands/run.py", line 388, in run
    install_hook_envs(hooks, store)
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/repository.py", line 206, in install_hook_envs
    _hook_install(hook)
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/repository.py", line 92, in _hook_install
    _write_state(hook.prefix, venv, _state(hook.additional_dependencies))
  File "/usr/local/Cellar/pre-commit/2.7.1_1/libexec/lib/python3.9/site-packages/pre_commit/repository.py", line 48, in _write_state
    with open(staging, 'w') as state_file:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/adithyabalaji/.cache/pre-commit/repo09b5y8iv/rbenv-system/.install_state_v1staging'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions