-
Notifications
You must be signed in to change notification settings - Fork 512
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
Add a pre commit config to help format before pushing #4258
base: master
Are you sure you want to change the base?
Conversation
Could you take a look when you have time? Thanks @Michaelvll |
Thanks @zpoint! Just realized that I did not install pre-commit in my python env. After installing it, it shows the above error for failing to find |
VSCode seems not to provide a way to configure the environment when you click the Workaround1:The workaround is to start VSCode from the command line after you activate your environment; in this way, VSCode will carry all the environment variables from your command line. If you are not using
workaround2:Install |
Step 1 install pre-commit
Step 2, now just run
git commit
. The command will use thepre-commit
hook on any unstaged file changesRefer to this comment if you're using cursor/vscode and encounter env problem
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh