-
Notifications
You must be signed in to change notification settings - Fork 13
Code Formatting Using Black and Flake8
Shiyang Pan edited this page Dec 17, 2023
·
2 revisions
A GitHub action has been set up to test the code format for every git push on main and dev branch, so it'll be better to fix the format error before pushing your code.
Run pip install -e .[lint] in terminal
Locate at the root directory of improv to trigger the black and flake8 customized configuration. Otherwise both will use their default configuration and cause potential conflict
Run black path_to_your_file
Run flake8 path_to_your_file
then manually fix all reported format error
black path_to_your_file
If there is any test failed in the action workflow, fix flake8 error reported in the workflow, redo steps in 'Before commit your code' section and push your code again