Autofix™

DeepSource not only finds issues in your code; but it also automatically fixes them for you, with our industry-first remediation engine called Autofix™. With Autofix™, you can generate fixes for hundreds of code health issues across all files in a repository and apply them as a new pull request or as a commit on an existing pull request, all with just a couple of clicks. It’s a feature a lot of DeepSource users swear by. In fact, thousands of issues are fixed every month with Autofix™ — saving countless hours by automating the grunt work of manually fixing seemingly trivial code health issues in the codebase.

Autofix™ is designed to be 100% safe and secure. As an added prevention layer, it doesn't automatically mutate the code. All pull requests created with the fixes go through the existing CI pipeline of a repository, ensuring there's no way that Autofix™ will break any functionality in the code. You’ll have full control over the results — the fixes are generated in the form of a git-compatible patch, making it easy to discard changes you don’t want to commit.

Installing the Autofix™ app

In the dashboard, you'll see a prompt to install the Autofix™ app. Simply click 'Install Autofix' to begin. If you're using an organization or team account, you can choose to install Autofix on all repositories or select repositories. After you click 'Install', you'll be taken to the VCS provider's App site to finish the setup.

Using Autofix™: The dashboard workflow

If you open an issue from the dashboard that has Autofix™ support, you’ll see the Autofix™ button on the top. All you have to do is click on it and confirm which files you want to run Autofix™ on.

It takes a few seconds for DeepSource to generate the fixes, and once you’ve verified all the fixes, click on the ‘Create pull request’ button, and DeepSource will create a pull request with fixes for this issue on your repository automatically.

Using Autofix™: The PR workflow

Once you’ve made a new pull request on your GitHub repository, DeepSource analysis will start right away. Once the checks finish, click on the ‘details’ action adjacent to a failing check to view the issues you’ve just introduced.

If any of these issues support Autofix™, you’ll see the Autofix™ button. In this case, the only difference is that running Autofix™ will create a commit directly on the PR