Skip to content

Review your code in the IDE

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Run a Sourcery review on the code you’re working on, read the findings inline, and apply a fix.

  1. Pick what to review

    In the Sourcery panel, choose a comparison mode.

    • Review current file reviews the file you’re in.
    • Compare with HEAD reviews your branch against its last commit.
    • Compare with <branch> reviews it against another branch.
  2. Click Review My Code

    Click Review My Code and wait for Sourcery to publish its findings.

  3. Read findings inline

    Findings appear as diagnostics on the lines they touch, the same way your linter’s warnings do. Open one to see the explanation and a suggested fix.

  4. Apply a fix

    Where Sourcery suggests a change, use the Apply fix action on the finding (the code action reads Sourcery - Apply fix) to write it into your code. You can resolve a finding without applying it if you’d rather handle it yourself.

The Sourcery panel also runs these recipes:

  • Generate Diagram
  • Generate Tests
  • Generate Docstrings
  • Explain Code

Chat has its own view in the panel, for free-form questions about your code.