install-pre-commit-hook.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Install pre-commit Hook for ESP-IDF Project
  2. ===========================================
  3. Required Dependency
  4. -------------------
  5. Python 3.6.1 or above. This is our recommendation python version for IDF developers.
  6. If you still have versions not compatible, please do not install pre-commit hook and update your python versions.
  7. Install pre-commit
  8. ------------------
  9. Run ``pip install pre-commit``
  10. Install pre-commit hook
  11. -----------------------
  12. 1. Go to the IDF Project Directory
  13. 2. Run ``pre-commit install --allow-missing-config``. Install hook by this approach will let you commit successfully even in branches without the ``.pre-commit-config.yaml``
  14. 3. pre-commit hook will run automatically when you're running ``git commit`` command
  15. What's More?
  16. ------------
  17. For detailed usage, Please refer to the documentation of pre-commit_.
  18. .. _pre-commit: http://www.pre-commit.com/
  19. Common Problems For Windows Users
  20. ---------------------------------
  21. 1. ``/usr/bin/env: python: Permission denied.``
  22. If you're in Git Bash or MSYS terminal, please check the python executable location by run ``which python``.
  23. If the executable is under ``~/AppData/Local/Microsoft/WindowsApps/``, then it's a link to Windows AppStore, not a real one.
  24. Please install python manually and update this in your ``PATH`` environment variable.