kpi-web-guild / django-girls-blog-OlenaEfymenko

django-girls-blog-OlenaEfymenko created by GitHub Classroom
MIT License
1 stars 0 forks source link

Configure pre-commit tool for this repo #12

Closed webknjaz closed 1 year ago

webknjaz commented 1 year ago

Rules:

  1. DO NOT commit to the main branch directly. ever.
  2. ABSOLUTELY NO force pushes allowed for public non-feature branches.
  3. For every feature, create a new branch matching name features/<issue-number>-<feature-name>.
  4. Submit every feature by creating Pull Request @ github, after that wait for review, fix issues, repeat until approved. If needed rebase the branch on top of main and re-push force it.
OlenaYefymenko commented 1 year ago

@webknjaz After execution command python3.11 -m pip install pre-commit --user, the following warning was received:

  WARNING: The script pre-commit is installed in '/home/olenayefymenko/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Can I just ignore this warning? In some recommendations, I found a solution: export PATH=$HOME/.local/bin:$PATH But I should use this variant: export PATH=$PYENV_ROOT/bin:$PATH for switching between versions

webknjaz commented 1 year ago

You can add the former to your zshrc file, additionally to the pyenv one. It prepends said path to the search paths. If not, you won't be able to invoke scripts installed in ~/.local/bin by their names (like pre-commit), though if they implement the runpy interface, you can still invoke (or import) them through the python interpreter (like python -m pre_commit).