Pre-commit suddenly fails to install Flake8
Asked Answered
Q

1

10

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'
Qumran answered 18/12, 2022 at 19:17 Comment(1)
your config uselessly excludes the empty string and .git -- neither of which will ever be picked up by pre-commitCassius
Q
19

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'
Qumran answered 18/12, 2022 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.