Skip to content

Commit 58a1c91

Browse files
Sourcery as a pre-commit hook
1 parent d731a99 commit 58a1c91

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ repos:
1111
- id: ruff
1212
args: ["--fix", "--show-fixes"]
1313
- id: ruff-format
14+
- repo: https://github.com/sourcery-ai/sourcery
15+
rev: v1.37.0
16+
hooks:
17+
- id: sourcery
18+
args: [--diff=git diff HEAD, --no-summary]
1419
- repo: https://github.com/codespell-project/codespell
1520
rev: v2.4.1
1621
hooks:

.sourcery.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# 🪄 This is your project's Sourcery configuration file.
2+
3+
# You can use it to get Sourcery working in the way you want, such as
4+
# ignoring specific refactorings, skipping directories in your project,
5+
# or writing custom rules.
6+
7+
# 📚 For a complete reference to this file, see the documentation at
8+
# https://docs.sourcery.ai/Configuration/Project-Settings/
9+
10+
# This file was auto-generated by Sourcery on 2025-06-20 at 14:38.
11+
12+
version: '1' # The schema version of this config file
13+
14+
ignore: # A list of paths or files which Sourcery will ignore.
15+
- .git
16+
- env
17+
- .env
18+
- .tox
19+
- node_modules
20+
- vendor
21+
- venv
22+
- .venv
23+
- ~/.pyenv
24+
- ~/.rye
25+
- ~/.vscode
26+
- .vscode
27+
- ~/.cache
28+
- ~/.config
29+
- ~/.local
30+
31+
rule_settings:
32+
enable:
33+
- default
34+
disable: [] # A list of rule IDs Sourcery will never suggest.
35+
rule_types:
36+
- refactoring
37+
- suggestion
38+
- comment
39+
python_version: '3.11' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.
40+
41+
# rules: # A list of custom rules Sourcery will include in its analysis.
42+
# - id: no-print-statements
43+
# description: Do not use print statements in the test directory.
44+
# pattern: print(...)
45+
# language: python
46+
# replacement:
47+
# condition:
48+
# explanation:
49+
# paths:
50+
# include:
51+
# - test
52+
# exclude:
53+
# - conftest.py
54+
# tests: []
55+
# tags: []
56+
57+
# rule_tags: {} # Additional rule tags.
58+
59+
# metrics:
60+
# quality_threshold: 25.0
61+
62+
# github:
63+
# labels: []
64+
# ignore_labels:
65+
# - sourcery-ignore
66+
# request_review: author
67+
# sourcery_branch: sourcery/{base_branch}
68+
69+
# clone_detection:
70+
# min_lines: 3
71+
# min_duplicates: 2
72+
# identical_clones_only: false
73+
74+
# proxy:
75+
# url:
76+
# ssl_certs_file:
77+
# no_ssl_verify: false
78+
79+
# coding_assistant:
80+
# project_description: ''
81+
# enabled: true
82+
# recipe_prompts: {}

0 commit comments

Comments
 (0)