Skip to content

Customizing Sourcery

Sourcery Code Reviews are configurable to allow you to tailor the components of our code reviews that we show, the language of the reviews, and to allow you to tailor your reviews more specifically to your codebase and your needs.

Basic Configuration

Sourcery's basic configuration is controlled through the Review Settings section in the Sourcery Dashboard.

Basic Configuration

Language Configuration You can set up Sourcery to deliver your code reviews in whatever language you prefer. Select your language from the dropdown menu and new reviews will be generated in that language.

Review Sections You can enable or disable the PR Summary, Review Guide, Mermaid Diagrams, Tips and Commands, AI Review Comments, and Approvals on PRs by toggling the buttons next to each section. The PR Summary, Review Guide, Diagrams, Tips and Comments, and AI Review Comments are enabled by default while PR Approvals is disabled by default.

Rule Comments You can enable or disable Sourcery's static analysis powered rules for Python or JavaScript within your PRs. These rules are focused on code quality and are strongly opinionated. A full list of rules is available here

Review Rules

Sourcery's reviews can be tailored to focus on topics and feedback that are more relevant to your team. You can add in specific review rules to tell Sourcery to look for specific issues or to not focus on certain things.

Review Rules

Specifying a Rule's Path Pattern

Review Rules can be tailored to only be triggered on certain areas of your project or specific file types. For any rule you need to define a file path glob pattern for that rule to apply to.

For example for an instruction to apply to all JS files in src and all TypeScript files the pattern would be: src/**/*.js,**/*.ts

Best Practices for Review Rules

Review Rules work the best when they are specific and structured as short, concise sentences or bullet points. While you can add multiple rules within a single input block we recommend that you keep your rules to fewer than 3 per block.