Skip to content

Git pre-commit hook should not check non-python, excluded files

username-removed-830294 requested to merge Curzy/flake8:git-hook into master

This commit fixes two problems that caused by git pre-commit hook

  1. flake8 checks non-python files(.md, .txt, ...) and raise errors
/var/folders/bb/0_8jdgw15f72f18m_fpqwcqr0000gn/T/tmpqbcrt3vn/Users/Curzy/Workspace/flative/hbnn/hbnn/README.md:3:2:
E999 SyntaxError: invalid syntax
/var/folders/bb/0_8jdgw15f72f18m_fpqwcqr0000gn/T/tmpqbcrt3vn/Users/Curzy/Workspace/flative/hbnn/hbnn/README.md:3:20:
E226 missing whitespace around arithmetic operator

this problem fixed with find_modified_files function

  1. flake8 checks excluded files by config(.flake8, config, ...)
[flake8]
ignore = F401
exclude =
    .git,
    __pycache__,
    hbnn/settings.py,
    manage.py,
    */migrations
./hbnn/settings.py:102:80: E501 line too long (83 > 79 characters)
./user/migrations/0001_initial.py:20:80: E501 line too long (88 > 79 characters)
./user/migrations/0001_initial.py:21:80: E501 line too long (103 > 79 characters)

this problem fixed with update_execuldes function should contain both original, temp paths

excuse my English

Merge request reports