# Fix Linting Errors

> Fix linting errors in a PR or Diff.

- Skill: `meta-pytorch/fix-linting-errors` (Agent Skill)
- Install (CLI): `npx skillmds@latest add meta-pytorch/fix-linting-errors`
- Raw SKILL.md: https://api.skillmd.com/api/skills/meta-pytorch/fix-linting-errors/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: meta-pytorch (https://skillmd.com/u/meta-pytorch)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/meta-pytorch/fix-linting-errors

---


# Fix linting errors

## Description

This skill fixes linting errors in a PR or Diff.

## Step 1: Check if ufmt is installed

Check if ufmt is installed by running `ufmt`.

If ufmt is not installed, install it by running `uv pip install -r requirements-fmt.txt`.

If in open source environment, find `requirements-fmt.txt` in the root of the repository.

If in Meta environment, find `requirements-fmt.txt` in `fbsource/tools/lint/pyfmt/reqs/requirements-fmt.txt`.

## Step 2: Run ufmt linter

Run `ufmt format <changed_file>` to format all the changed file in the Diff or PR.


