简体   繁体   中英

Pre-commit suddenly fails to install Flake8

The pre-commit run suddenly fails without changes being made to the pre-commit configuration file. The log shows the following error message when attempting to initialise the environment for Flake8:

...
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.git.
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')
return code: 128
expected return code: 0
stdout: (none)
stderr:
    fatal: could not read Username for 'https://gitlab.com': No such device or address
...

The pre-commit configuration file includes the following entry:

---
repos:
- repo: https://gitlab.com/pycqa/flake8.git
  rev: 3.9.2
  hooks:
  - id: flake8
    exclude: 'tests|env|docs'

The Flake8 project has moved to GitHub and requires updating the repository URL in the pre-commit configuration file:

---
repos:
- repo: https://github.com/pycqa/flake8.git
  rev: 3.9.2
  hooks:
  - id: flake8
    exclude: 'tests|env|docs'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM