File tree Expand file tree Collapse file tree 5 files changed +28
-27
lines changed
Expand file tree Collapse file tree 5 files changed +28
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -13,15 +13,10 @@ repos:
1313 hooks :
1414 - id : black
1515
16- - repo : https://github.com/PyCQA/flake8
17- rev : 7.0.0
16+ - repo : https://github.com/astral-sh/ruff-pre-commit
17+ rev : v0.4.4
1818 hooks :
19- - id : flake8
20-
21- - repo : https://github.com/timothycrosley/isort
22- rev : 5.13.2
23- hooks :
24- - id : isort
19+ - id : ruff
2520
2621 - repo : https://github.com/asottile/pyupgrade
2722 rev : v3.15.2
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def _handle_class_on_module(
111111 if inspect .getsourcefile (member ) != inspect .getsourcefile (parent ):
112112 return None
113113
114- if issubclass (member , ( Exception , Warning ) ):
114+ if issubclass (member , Exception | Warning ):
115115 return None
116116
117117 yield Klass (
Original file line number Diff line number Diff line change @@ -38,3 +38,25 @@ DJANGO_SETTINGS_MODULE = "core.settings"
3838python_files = [
3939 " test_*.py" ,
4040]
41+
42+ [tool .ruff ]
43+ extend-exclude = [
44+ " .env" ,
45+ ]
46+ target-version = " py310"
47+
48+ [tool .ruff .lint ]
49+ extend-select = [
50+ " A" , # flake8-builtins
51+ " I" , # isort
52+ " INP" , # flake8-no-pep420
53+ " ISC" , # flake8-implicit-str-concat
54+ " UP" , # pyupgrade
55+ " W" , # pycodestyle warning
56+ ]
57+ extend-ignore = [
58+ " E731" , # allow lambda assignment
59+ ]
60+
61+ [tool .ruff .lint .isort ]
62+ lines-after-imports = 2
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class Meta:
1515 model = Module
1616
1717 project_version = factory .SubFactory (ProjectVersionFactory )
18- name = factory .Sequence ("module{}" . format )
18+ name = factory .Sequence (lambda n : f "module{ n } " )
1919
2020
2121class KlassFactory (factory .django .DjangoModelFactory ):
@@ -25,11 +25,7 @@ class Meta:
2525 module = factory .SubFactory (ModuleFactory )
2626 name = factory .Sequence ("klass{}" .format )
2727 line_number = 1
28- import_path = factory .LazyAttribute (
29- lambda a : "Django.{module}" .format (
30- module = a .module .name ,
31- )
32- )
28+ import_path = factory .LazyAttribute (lambda a : f"Django.{ a .module .name } " )
3329
3430
3531class InheritanceFactory (factory .django .DjangoModelFactory ):
You can’t perform that action at this time.
0 commit comments