预提交突然无法安装 Flake8

Roa*_*efs 9 pre-commit flake8 pre-commit.com

在未对预提交配置文件进行更改的情况下,预提交运行突然失败。尝试初始化 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
...
Run Code Online (Sandbox Code Playgroud)

预提交配置文件包含以下条目:

---
repos:
- repo: https://gitlab.com/pycqa/flake8.git
  rev: 3.9.2
  hooks:
  - id: flake8
    exclude: 'tests|env|docs'
Run Code Online (Sandbox Code Playgroud)

Roa*_*efs 17

Flake8 项目已移至 GitHub,需要更新预提交配置文件中的存储库 URL:

---
repos:
- repo: https://github.com/pycqa/flake8.git
  rev: 3.9.2
  hooks:
  - id: flake8
    exclude: 'tests|env|docs'
Run Code Online (Sandbox Code Playgroud)