Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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'
like image 613
Roald Nefs Avatar asked Apr 19 '26 00:04

Roald Nefs


1 Answers

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'
like image 192
Roald Nefs Avatar answered Apr 25 '26 04:04

Roald Nefs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!