Fixing Formatting Briefly
00:00 First, I made a mistake at the end of the last lesson. On line 13, when declaring a variable, I didn’t put spaces around the equals sign and therefore my code no longer conforms to PEP 8 guidelines.
00:12
You can confirm that by going over to the terminal, running our formatter ruff. I’ll type ruff check name of the file, so quote_generator.py, and you see that returns an error message because it tells me there is a missing whitespace around the operator.
00:31
I can run the same previous command just with --fix at the end to automatically fix this. When I run that, ruff tells me it found one error and fixed it. If I go back to the code, now there are spaces around the equals sign so my code again conforms to PEP 8 guidelines.
Become a Member to join the conversation.
