To activate continuous analysis on additional repositories, follow these steps:
- Go to the dashboard and click on “Activate new repo” on the sidebar.
- A list of all the repositories synced with your VCS account will appear on the screen.
- Select the repository you want, and the configuration generator will appear.
- Select the Analyzers you want to enable based on your requirements. You can read more about the configuration options for each Analyzer here.
- Once you’ve selected the Analyzers you want, DeepSource will generate a .deepsource.toml file that serves as the analysis configuration’s source of truth.
The analysis configuration for a repository on DeepSource is defined in a .deepsource.toml file in the repository's root. This file must be present at the said location for analysis to be run.
- In the ‘Test file patterns’ section, you can add a list of glob patterns to identify as test files. This will help reduce the number of false positive issues after analysis.
- Based on your repository’s branch permissions, you can directly commit the .deepsource.toml file to your default branch from DeepSource, create a pull request that you can merge from your VCS provider, or manually add this file in your repository’s root.
- Once the file has been committed, the analysis will run on the default branch of the repository and analyze all the files.
In addition to detecting issues, DeepSource lets you automatically format source code with Transformers on every commit. This ensures that your code is consistently formatted without any conflicts.
Here's how to use Transformers:
- In the configuration generator, select the Transformers you want to use.
- The .deepsource.toml file will be updated automatically.
- Alternatively, you can manually copy the configuration from the DeepSource Directory and add it to the .deepsource.toml file.
- When you create a pull request, all Transformers enabled in the .deepsource.toml file are run, and the changes detected are committed back to that branch. If the changes are committed directly to the default branch, a new pull request is created with the transformations.
.deepsource.toml file and enabling DeepSource on numerous repositories can be a daunting task for large teams, particularly for our Enterprise customers. To address this issue, we developed Auto Onboard. With Auto Onboard, you can create configuration templates that serve as blueprints and use them to activate analysis on multiple repositories with just one click.
To create a configuration template, follow these steps:
- Navigate to the 'Settings' page from the dashboard. (Note: Auto Onboard is currently not available for individual accounts.)
- Under the 'Auto Onboard' section, click on 'Add new template'.
- Provide a descriptive name and summary.
- Add all the necessary analyzers and transformers.
To activate DeepSource in multiple repositories using Auto Onboard, follow these simple steps:
- Click the "Activate new repository" button located in the sidebar.
- Select the "Use AutoOnboard" option and choose the template you want to use. Alternatively, you can directly click the "Use this template" button from the template page.
- Select all the repositories you want to onboard, and then click the "Start onboarding" button.
Updated 2 months ago