pre-commit.com

Pylint with pre-commit and EsLlint with husky

你离开我真会死。 提交于 2020-12-26 19:56:52
问题 I have a project with a frontend in JS and backend in Python. Frontend had been configured with husky pre-commit hook. Today I've configured Pylint with pre-commit library but husky hooks had been overwritten by that move. Is it possible to combine pre-commit and husky libraries? If not... what's the best way to solve the problem? 回答1: pre-commit has a "migration mode" for running other existing hook frameworks. It seems that husky is slightly too clever in their hook implementation for

Python pre-commit unittest faild

可紊 提交于 2020-01-14 02:39:19
问题 I wish pre-commit to run the tests before committing my code. The command python -m unittest discover is working in the command line. D:\project_dir>python -m unittest discover ... ... ... ---------------------------------------------------------------------- Ran 5 tests in 6.743s OK But when trying to commit I am getting D:\project_dir>git commit -m "fix tests with hook" run tests................................................................Failed hookid: tests usage: python.exe -m

autopep8 doesn't seem to be finding config file?

大城市里の小女人 提交于 2019-12-23 01:40:40
问题 According to autopep8's documentation (here: https://github.com/hhatto/autopep8#configuration ), if I place a file called "setup.cfg" in the root of my git repo, with something like [pycodestyle] ignore = D203,E501,E201,E202,E203,E211,E261,E265,W503 exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,__init__.py,*_gui.py max-complexity = 25 max-line-length = 160 statistics = True then it should pick up that config. I'm using autopep8 via the pre-commit hook, here: https://github.com

autopep8 doesn't seem to be finding config file?

隐身守侯 提交于 2019-12-09 03:44:24
According to autopep8's documentation (here: https://github.com/hhatto/autopep8#configuration ), if I place a file called "setup.cfg" in the root of my git repo, with something like [pycodestyle] ignore = D203,E501,E201,E202,E203,E211,E261,E265,W503 exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,__init__.py,*_gui.py max-complexity = 25 max-line-length = 160 statistics = True then it should pick up that config. I'm using autopep8 via the pre-commit hook, here: https://github.com/pre-commit/mirrors-autopep8 Best I can tell, it's not finding the setup.cfg. I also have a .flake8