hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.54k stars 291 forks source link

Pre-commit repo missing the .pre-commit-hooks.yaml file #692

Closed keriksson-rosenqvist closed 9 months ago

keriksson-rosenqvist commented 11 months ago

I am trying to get autopep8 to run as part of my pre-commit suit but when I try to add it to the project I get an error that the .pre-commit-hooks.yaml file does not exist in the pulled repository. I can see the file in the github repo when viewing it in the browser but it is not included in the local repo directory. All other pre-commit repos/hooks are working as expected.


Command Line and Configuration

pyproject.toml

[tool.autopep8]
max_line_length = 92
exclude = ".venv,logs"

.pre-commit-config.yaml

repos:
  - repo: https://github.com/hhatto/autopep8
    rev: v2.0.2
    hooks:
      - id: autopep8

Command Line

$ git add pyproject.toml poetry.lock .pre-commit-config.yaml 
$ git commit -m "Autopep8"
An error has occurred: InvalidManifestError: 
=====> /home/kajsa/.cache/pre-commit/repon8wn9lpf/.pre-commit-hooks.yaml is not a file
Check the log at /home/kajsa/.cache/pre-commit/pre-commit.log
$ la ~/.cache/pre-commit/repon8wn9lpf/
AUTHORS.rst       coveralls.bash  .gitignore          LICENSE      README.rst  test
autopep8.py       .git            hooks               Makefile     setup.cfg   tox.ini
CONTRIBUTING.rst  .github         install_hooks.bash  MANIFEST.in  setup.py    update_readme.py

Your Environment

keriksson-rosenqvist commented 11 months ago

Made a PR that fixes the issue here.

asottile commented 9 months ago

that PR does not fix things -- the pre-commit configuration is only present in v2.0.3 onwards -- you have selected v2.0.2