From the course: Create an Open-Source Project in Python
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Linting your code with Flake8 - Python Tutorial
From the course: Create an Open-Source Project in Python
Linting your code with Flake8
- [Instructor] In this video we'll use Flake8 to check the format of our code. Before we start, let's check if we have Flake8 installed. In my environment, I'm using version 5.0.4. Now we will try to use Flake8 to check our code. Remember that we used Black to reformat tests.py. Let's use Flake8 to check if there's any formatting problems with it. As you can see, nothing happened. This is good news. Flake8 did not pick up any problems. Our code seems to be okay, which is expected since we already use Black to clean up the code. However, it is no fun when everything works fine. Let's have a look at reminder.py. Whoa. As you can see, Flake8 has picked up quite a lot of problems in the code's format. Guess what we must do now? Yes, that's right. We can use Black on reminder.py to clean things up a bit. Okay, now that we have reformed reminder.py let's use Flake8 to check again. Oh no. There's still three problems…