Loading topic
pyproject.toml. You do not need prior experience with any linter or formatter.2 min readpip install ruff. It covers ruff check, the linting command. Rule codes, configuration, and fixes get their own chapters.2 min readruff check and read its output. Here you learn how to read the codes in that output, because rule selection and suppression both depend on them.2 min readruff check and ruff format, you know basic TOML syntax, and you have a Python project with a pyproject.toml at its root. Rule selection and autofix get their own chapters, so here we cover where Ruff reads its settings and what the main sections do.3 min readruff check, read the rule codes it prints (such as F401), and edit a [tool.ruff] section in pyproject.toml. Here you control which rules Ruff applies to your project.3 min readruff check, read rule codes such as F401, and edit the [tool.ruff.lint] section of pyproject.toml. Many violations come with a fix that Ruff can apply for you. You will learn how to apply fixes, what separates a safe fix from an unsafe one, and how to keep co3 min readruff check at least once, and can read a pyproject.toml file. Here you will learn what ruff format does, how to preview and verify its changes, and which options you can set.2 min readruff check, read rule codes such as F401, and edit pyproject.toml. Sometimes a rule is right in general but wrong for one line. A # noqa comment lets you silence it there, and leaves the rule on everywhere else.3 min readruff check, read rule codes such as F401, and edit the [tool.ruff.lint] section of pyproject.toml. If any of these is new, review the chapters on rule codes and rule selection first.3 min readruff check, read rule codes, and edit pyproject.toml. Import sorting in Ruff is a set of lint rules, not a separate tool. It uses the I prefix and follows isort's conventions.3 min readruff check and ruff format, and that you can edit the [tool.ruff] tables in pyproject.toml. It also assumes you know how rule codes and prefixes select rules.2 min readruff check and ruff format, and that Ruff is configured in pyproject.toml. It also assumes you know basic Git and can read a YAML file. Here you will run the same checks automatically on every commit and on every pull request.2 min readruff check and ruff format in a terminal works, but you get faster feedback if your editor shows violations as you type. This chapter assumes you can run ruff check and ruff format from the command line and can read a pyproject.toml file.3 min readpyproject.toml, and know the basics of ruff check and ruff format. Ruff replaces all three tools, so a migration mostly means translating their settings and deleting them.2 min read