Autofix

A review leaves findings on a pull request, and someone still has to fix them. Autofix hands that work back to Codity: comment @codity fix on the pull request or merge request, and Codity commits fixes for the findings that are still open.

The fixes go to the pull request branch, or to a separate pull request if you ask for one. Codity replies on the pull request, listing any finding it skipped and why.

Commands

Comment on the pull request or merge request:

Comment What happens
@codity fix Codity commits the fixes to the pull request branch.
@codity fix stacked pr Codity opens the fixes as a separate pull request against the pull request branch, instead of committing to it.
@codity fix followed by any other text Codity replies with the accepted forms of the command. Nothing runs.

@codity autofix, @codity auto-fix and @codity auto fix work the same as @codity fix.

For a separate pull request, stacked-pr, stackedpr, new pr and as a pr work the same as stacked pr:

@codity fix as a pr

What Gets Fixed

Autofix works through the review's findings that are still open, most severe first.

Some findings are skipped:

  • Findings that were already fixed
  • Findings whose code no longer exists
  • Findings whose review threads were resolved

The reply lists each skipped finding with the reason it was skipped.

Every file Codity edits gets a syntax check.

Platforms

Autofix works on GitHub, GitLab, Bitbucket and Azure DevOps.

Turning It On

Autofix is available on the Premium plan and is off by default. Enable it under Settings → Review → Autofix, for your whole organization or for a single repository.

What It Costs

Each autofix run uses one Review / Scan job from your organization's pool. See Usage and Limits for how the pools work.

Autofix and the Claude Code Plugin

The Claude Code plugin has a /codity:fix command. It is a different flow: it runs locally in Claude Code and asks you to approve or skip each fix before it is applied. @codity fix runs from a comment on the pull request, and Codity delivers the fixes itself, as commits or as a separate pull request.

Additional Resources