Type object
File match .sourcery.yaml
Schema URL https://catalog.lintel.tools/schemas/schemastore/sourcery/latest.json
Source https://www.schemastore.org/sourcery_yaml_schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

version string

The schema version of this config file

Default: "1"
ignore string[]

A list of paths or files which Sourcery will ignore.

Default:
[]
rule_settings
Default:
{
  "enable": [
    "default"
  ],
  "disable": [],
  "include": [],
  "skip": [],
  "rule_types": [
    "refactoring",
    "suggestion",
    "comment"
  ],
  "python_version": null,
  "allow_adding_imports": false
}
All of: RuleSettingsConfig object
rules RuleConfig[]

A list of custom rules Sourcery will include in its analysis.

Default:
[]
rule_tags Record<string, string[]>

Additional rule tags.

Default:
{}
metrics
Default:
{
  "quality_threshold": 25
}
All of: MetricsConfig object
github
Default:
{
  "labels": [],
  "ignore_labels": [
    "sourcery-ignore"
  ],
  "review_or_request_review": "author",
  "sourcery_branch": "sourcery-dev/{base_branch}"
}
All of: GitHubConfig object
clone_detection
Default:
{
  "min_lines": 3,
  "min_duplicates": 2,
  "identical_clones_only": false
}
All of: CloneDetectionConfig object
proxy
Default:
{
  "url": null,
  "ssl_certs_file": null,
  "no_ssl_verify": false
}
All of: ProxyConfig object

Definitions

RuleType enum

An enumeration.

PythonVersion object
major integer required
minor integer required
RuleSettingsConfig object
enable string[]
Default:
[
  "default"
]
disable string[]

A list of rule IDs Sourcery will never suggest.

Default:
[]
rule_types RuleType[]
Default:
[
  "refactoring",
  "suggestion",
  "comment"
]
python_version string | PythonVersion

A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.

RuleLanguage string

An enumeration.

PathsConfig object
include string[]
exclude string[]
MatchRuleTestConfig object
match string required
expect string
NoMatchRuleTestConfig object
no-match string required
RuleConfig object
id string required
maxLength=88pattern=^[A-Za-z][A-Za-z0-9-_/:]*$
description string required
pattern string required
language
Default: "python"
All of: RuleLanguage string
replacement string
condition string
explanation string
paths object
2 nested properties
include string[]
exclude string[]
tests MatchRuleTestConfig | NoMatchRuleTestConfig[]
Default:
[]
tags string[]
Default:
[]
MetricsConfig object
quality_threshold number
Default: 25.0
RequestReview object
origin string
Default: ""
forked string
Default: ""
GitHubConfig object
labels string[]
Default:
[]
ignore_labels string[]
Default:
[
  "sourcery-ignore"
]
request_review string | RequestReview
Default: "author"
sourcery_branch string
Default: "sourcery-dev/{base_branch}"
CloneDetectionConfig object
min_lines integer
Default: 3
min_duplicates integer
Default: 2
identical_clones_only boolean
Default: false
ProxyConfig object
url string
format=uriminLength=1maxLength=65536
ssl_certs_file string
no_ssl_verify boolean
Default: false