Loading video player…

Modern Python Linting With Ruff (Overview)

Linting is essential to writing clean and readable code that you can share with others. A linter, like Ruff, is a tool that analyzes your code and looks for errors, stylistic issues, and suspicious constructs. Linting allows you to address issues and improve your code quality before you commit your code and share it with others.

Ruff is a modern linter that’s extremely fast and has a simple interface, making it straightforward to use. It also aims to be a drop-in replacement for many other linting and formatting tools, such as Flake8, isort, and Black. It’s quickly becoming one of the most popular Python linters.

In this video course, you’ll learn how to:

  • Install Ruff
  • Check your Python code for errors
  • Automatically fix your linting errors
  • Use Ruff to format your code
  • Add optional configurations to supercharge your linting

Resource mentioned in this lesson: Managing Python Projects With uv: An All-in-One Solution

Download

Course Slides (.pdf)

1.1 MB
Download

Sample Code (.py)

468 bytes

00:00 Welcome to the Modern Python Linting With Ruff video course. You will be using Ruff to lint and format your code. But what is this thing? Well, Ruff is a popular linter and formatter that was created by Astral, which you might know from the tool uv.

00:17 So uv and Ruff were created by the same company. In this video course, you’re going to learn to do a couple of different things. You’ll learn how to lint your code with Ruff, how to fix the linting errors that you find automatically, how to check your code continuously for these errors, how to customize the rules that Ruff checks for.

00:41 You’re going to learn how to format your code, and we will also learn how to create a configuration file for Ruff, so that your configuration settings persist.

00:52 Now in this course, it’s assumed you already know what linting and formatting are, why you would care about those things. But just as a quick reminder, formatting your code means applying stylistic changes so that your code looks consistent, and it’s stylistic changes only that should not affect the functionality of your code at all.

01:13 And linting is a process of analyzing your code statically, which means without running your code to look for potential code smells according to some standards or best practices guides, looking for potential bugs and other minor things like this, that you could fix without even running your code.

01:33 And in this course, you will learn how to use Ruff to do this. So the focus of the course is on the tool, not the concepts of linting and formatting. So without further ado, let’s get started.

Become a Member to join the conversation.