Olá professor, depois de horas tentando configurar o flake8 para funcionar com o git hooks acabei desistindo.
o erro: "fatal: cannot run .git/hooks/pre-commit: No such file or directory"
o arquivo pre-commit existia e quando eu executava python3 .git/hooks/pre-commit funcionava perfeitamente, mas ele dava aquele erro sempre que eu tentava commitar
depois instalei o pre-commit pelo pip e segui estas instruções aqui: https://pre-commit.com/#pre-commit-configyaml---hooks
mas ainda assim não consegui, recebia este erro: An unexpected error has occurred: ExecutableNotFoundError: Executable "/home/sora/Documents/Courses
not found
Check the log at /home/sora/.cache/pre-commit/pre-commit.log"
o log é este:
error information
An unexpected error has occurred: ExecutableNotFoundError: Executable `/home/sora/Documents/Courses` not found
`
Traceback (most recent call last):
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/error_handler.py", line 56, in error_handler
yield
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/main.py", line 372, in main
args=args.rest[1:],
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/commands/hook_impl.py", line 210, in hook_impl
retv, stdin = runlegacy(hook_type, hook_dir, args)
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/commands/hook_impl.py", line 42, in runlegacy
cmd = normalize_cmd((legacy_hook, *args))
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/parse_shebang.py", line 82, in normalize_cmd
exe = normexe(cmd[0])
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/pre_commit/parse_shebang.py", line 61, in normexe
error('not found')
File "/home/sora/Documents/CoursesProjects/Alura/Python/PEP-8/venv/lib/python3.7/site-packages/precommit/parse_shebang.py", line 51, in error
raise ExecutableNotFoundError(f'Executable {orig}
{msg}')
precommit.parse_shebang.ExecutableNotFoundError: Executable /home/sora/Documents/Courses
not found
Tente de tudo, até resetei o repositório e também meu ambiente virtual, mas de nada adiantou