Я пытался настроить pylint
с pre-commit
в моем проекте.
Я пришел к этому ответу, где они рассказывают, как настроить мой .pre-commit-config.yaml
.
Когда Я пошел в репозиторий , упомянутый в ответе, они написали, что
Этот зеркальный репозиторий устарел, используйте pylint напрямую.
Итак, я установил свой .pre-commit-config.yaml
файл следующим образом
- repo: https://github.com/pycqa/pylint
rev: pylint-2.4.4
hooks:
- id: pylint
args:
- --limit=8
- --rcfile=$PROJECT_ROOT/.pylintrc
Но теперь, когда я попытался сделать
$ pre-commit run
, он выдал следующую ошибку:
An unexpected error has occurred: CalledProcessError: command: ('/Users/userabc/.cache/pre-commit/repokxyo7uuq/py_env-default/bin/python', '/Users/userabc/.cache/pre-commit/repokxyo7uuq/py_env-default/bin/pip', 'install', '.')
return code: 1
expected return code: 0
stdout:
Processing /Users/userabc/.cache/pre-commit/repokxyo7uuq
stderr:
ERROR: Command errored out with exit status 1:
command: /Users/userabc/.cache/pre-commit/repokxyo7uuq/py_env-default/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gm/t0h6v8jx4bqd6cj73_k27myw0000gp/T/pip-req-build-5vjdd9f2/setup.py'"'"'; __file__='"'"'/private/var/folders/gm/t0h6v8jx4bqd6cj73_k27myw0000gp/T/pip-req-build-5vjdd9f2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/gm/t0h6v8jx4bqd6cj73_k27myw0000gp/T/pip-req-build-5vjdd9f2/pip-egg-info
cwd: /private/var/folders/gm/t0h6v8jx4bqd6cj73_k27myw0000gp/T/pip-req-build-5vjdd9f2/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/gm/t0h6v8jx4bqd6cj73_k27myw0000gp/T/pip-req-build-5vjdd9f2/setup.py", line 60, in <module>
long_description = stream.read()
File "/Users/userabc/.pyenv/versions/3.5.2/lib/python3.5/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 4020: ordinal not in range(128)
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Check the log at /Users/userabc/.cache/pre-commit/pre-commit.log
Версия python моего проекта и виртуальной среды 3.5.2
.
Это ошибка в pylint
или pre-commit
? Или я что-то не так делаю?