Skip to content

Commit

Permalink
updated sourcery configuration (.sourcery.yaml)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claas committed Dec 1, 2022
1 parent 6a3ad78 commit 1fd340a
Showing 1 changed file with 31 additions and 80 deletions.
111 changes: 31 additions & 80 deletions .sourcery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,45 @@
# 📚 For a complete reference to this file, see the documentation at
# https://docs.sourcery.ai/Configuration/Project-Settings/

# This file was auto-generated by Sourcery on 2022-10-13 at 18:12.
# This file was auto-generated by Sourcery on 2022-11-24 at 15:30.

version: '1' # The schema version of this config file
version: '1' # The schema version of this config file

ignore: # A list of paths or files which Sourcery will ignore.
- .git
- venv
- .venv
- env
- .env
- .git
- venv
- .venv
- env
- .env
- .tox

refactor:
include: []
skip: [] # A list of rule IDs Sourcery will never suggest.
rule_settings:
enable:
- default
disable: [] # A list of rule IDs Sourcery will never suggest.
rule_types:
- refactoring
- suggestion
- comment
python_version: '3.9'
- refactoring
- suggestion
- comment
python_version: '3.9' # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.

rules: # A list of custom rules Sourcery will include in its analysis.
# - id: no-print-statements
# description: Do not use print statements in the test directory.
# pattern: print(...)
# replacement:
# condition:
# explanation:
# paths:
# include:
# - test
# exclude:
# - conftest.py
# tests: []
- id: snake-case-variable-declarations
pattern: |
${var}: ${type_annotation}
condition: not var.is_snake_case() and not var.in_module_scope()
description: Use snake case for variable names - `${var}`
replacement: var
explanation: |
Use snake case for variables.
# rules: # A list of custom rules Sourcery will include in its analysis.
# - id: no-print-statements
# description: Do not use print statements in the test directory.
# pattern: print(...)
# replacement:
# condition:
# explanation:
# paths:
# include:
# - test
# exclude:
# - conftest.py
# tests: []
# tags: []

This rule catches only variables that were declared with a type annotation.
# rule_tags: {} # Additional rule tags.

From Google Style Guide [3.16.2](https://google.github.io/styleguide/pyguide.html#s3.16.2-naming-conventions) and [PEP 8](https://peps.python.org/pep-0008/#function-and-variable-names)
tests:
- match: |
def some_function():
miXed: int
- match: |
def some_function():
UpperCamelCase: int
- match: |
def some_function():
UpperCamelCase42: int
- match: |
def some_function():
mixed_and_underScore: int
- match: |
def some_function():
too__many__underscores: str
- match: |
def some_function():
_too__many__underscores: str
- match: |
def some_function():
___3_underscores_prefix: str
- match: |
def some_function():
double_underscore_suffix__: str
- no-match: |
def some_function():
nr: int = 42
- no-match: |
def some_function():
miXed: int = 42
- no-match: |
def some_function():
snake_nr: int = 42
- no-match: simple_NR = 42
- no-match: CONTEXT = "whatever"
- no-match: |
def some_function():
_initial_value: int = 0
- no-match: |
def some_function():
__initial_value: int = 0
- no-match: __version__ = "3.14"
# metrics:
# quality_threshold: 25.0

Expand Down

0 comments on commit 1fd340a

Please sign in to comment.