Skip to content

user does not need to run format and test manually anymore #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
12rambau opened this issue Apr 5, 2023 · 2 comments
Open
1 task done

user does not need to run format and test manually anymore #698

12rambau opened this issue Apr 5, 2023 · 2 comments

Comments

@12rambau
Copy link
Contributor

12rambau commented Apr 5, 2023

Type

  • Content inaccurate

URL

https://commitizen-tools.github.io/commitizen/contributing/

Description

I just edited the pre-commit hook in a PR and I realized the test and format script are run internally. would it make sense to remove these steps from both the contributing documentation and the PR checklist ?

On the other hand I faced many dificulties running them as my nevironment was missing a lot of the test/formatting dependencies. wouldn't it be better if these tests were run using isolated environments using either nox or tox ?

happy to make a PR

@woile
Copy link
Member

woile commented Apr 6, 2023

I personally prefer to use the scripts and let the CI handle different python versions.
What kind of difficulties did you have with the test/formatting? If you do poetry install you should have all the deps, including the development deps. There's a chance the problem is actually poetry, which is deprecating the section tool.poetry.dev-dependencies and instead, we have to create a new group tool.poetry.groups.dev for example

@12rambau
Copy link
Contributor Author

12rambau commented Apr 7, 2023

nox is not forcing you to test multiple version of python. If you don't sepcify anything in the session parameter, it will use the python installed on your computer (in my case 3.10).

Note that it is not recommended to run the tests in pre-commits (quoting the author of pre-commits):

  • tests are often slow, committing should be fast
  • It would have to be a system / script hook since you'd need repository specific dependencies installed (as you've noticed)

The format script could be drop all together by using richer pre-commit hooks (namely the holy trinity: ruff, black, prettier)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants