How Code Linters Can Help You Write More Pythonic Code
In this first video of the course you’ll get a basic definition of what a linter actually is and how it can improve your way of writing code. Finally, objectives of the course are set.
00:00 Hey there! This is Dan Bader, and in this video tutorial, you’re going to learn how to use the Pylint linter for Python. So you might be wondering, “What is, actually, a code linter?” A code linter is a program that inspects your Python code and, essentially, it gives you feedback on your Python code.
00:19 The linter will inspect, for example, this file over here. I’ve got some example file that is kind of iffy, it’s not great Python code, there’s some formatting issues.
00:32 Some common issues are in there. For example, I’m not using some of the variables that I’m declaring here and it’s… it could be improved, you know—let’s just keep it at that.
00:41 A linter is a program that can identify these issues and tell you how to resolve them in a fully automated way. So, essentially, it’s almost like a robot tutor for your Python programs.
00:56 The great thing is, because a linter is a program, it can just constantly run in the background or you can run it when you run your automated tests or when your team runs your automated tests.
01:06 So it’s a great way to ensure a certain minimum quality standard when it comes to your Python code or the Python code of your team or your whole company.
01:14 So it’s a really, really great tool. There are a number of linters available for Python. In this tutorial, I’m going to talk about Pylint and show you how to set it up and how to install it.
Become a Member to join the conversation.