Skip to content

Overview

Sourcery ships with various optional rules. These also reflect general and Python best practices, but are more opinionated than the default rules Try out the optional rules and pick the ones that are relevant for your project.

All optional rules can be found in the public sourcery-rules repo

Enable Optional Rules in Your Sourcery ConfigΒΆ

You can add the whole GPSG rule set or a subset of it to your project's .sourcery.yaml config file. This way, Sourcery will use these rules anytime it reviews your project in your IDE.

To configure the whole Google Python Style Guide:

rule_settings:  enable:  - default  - gpsg 

To configure only the import rules from the Google Python Style Guide:

rule_settings:  enable:  - default  - gpsg-import