-2

I have a problem when executing the pre-commit in a python project, although my files have the correct format, it shows an error and removes the correct format. Could you help me find out what is causing this

problem.flake8...................................................................
Failed - hook id: flake8 - exit code: 1 
tests/test_service.py:153:80: E501 line too long (85 > 79 characters) tests/test_service.py:158:80: E501 line too long (80 > 79 characters) tests/test_service.py:162:80: E501 line too long (83 > 79 characters) tests/test_service.py:170:80: E501 line too long (85 > 79 characters) tests/test_service.py:178:80: E501 line too long (84 > 79 characters) tests/test_service.py:184:80: E501 line too long (83 > 79 characters) tests/test_service.py:201:80: E501 line too long (83 > 79 characters)

validate correct format in files

anthony sottile
  • 61,815
  • 15
  • 148
  • 207
Lana
  • 117
  • 5

1 Answers1

0

Your lines are too long (you have set the maximum length to 79 characters). You can configure the hook to omit this alert, or modify it to support a longer maximum length.

For example, in you pre-commit file:

minimum_pre_commit_version: 2.11.0
default_stages: [commit, push, manual]
repos:
  - repo: https://github.com/psf/black
    rev: 22.12.0
    hooks:
      - id: black
  - repo: https://github.com/pycqa/flake8
    rev: 6.0.0
    hooks:
      - id: flake8
        args: [--max-line-length=**HereYourMaxLength**]
marcobd
  • 19
  • 2