@@ -35,21 +35,13 @@ opentelemetry-exporter-otlp-proto-http = "1.21.0"
35
35
optional = true
36
36
37
37
[tool .poetry .group .format .dependencies ]
38
- black = " ^24.4.2"
39
- isort = " ^5.13.2"
38
+ ruff = " ^0.4.5"
40
39
41
40
[tool .poetry .group .lint ]
42
41
optional = true
43
42
44
43
[tool .poetry .group .lint .dependencies ]
45
- black = " ^24.4.2"
46
- isort = " ^5.13.2"
47
- flake8 = " ^7.0.0"
48
- flake8-docstrings = " ^1.7.0"
49
- flake8-copyright = " ^0.2.4"
50
- flake8-builtins = " ^2.5.0"
51
- pyproject-flake8 = " ^7.0.0"
52
- pep8-naming = " ^0.14.1"
44
+ ruff = " ^0.4.5"
53
45
codespell = " ^2.3.0"
54
46
55
47
[tool .poetry .group .unit .dependencies ]
@@ -85,34 +77,40 @@ log_cli_level = "INFO"
85
77
markers = [" unstable" ]
86
78
87
79
# Formatting tools configuration
88
- [tool .black ]
80
+ [tool .ruff ]
81
+ # preview and explicit preview are enabled for CPY001
82
+ preview = true
83
+ target-version = " py38"
84
+ src = [" src" , " ." ]
89
85
line-length = 99
90
- target-version = [" py38" ]
91
86
92
- [tool .isort ]
93
- profile = " black"
94
-
95
- # Linting tools configuration
96
- [tool .flake8 ]
97
- max-line-length = 99
98
- max-doc-length = 99
99
- max-complexity = 10
100
- exclude = [" .git" , " __pycache__" , " .tox" , " build" , " dist" , " *.egg_info" , " venv" ]
101
- select = [" E" , " W" , " F" , " C" , " N" , " R" , " D" , " H" ]
102
- # Ignore W503, E501 because using black creates errors with this
103
- # Ignore D107 Missing docstring in __init__
104
- # Ignore D105 Missing docstring in magic method
105
- # Ignore D415 Docstring first line punctuation (doesn't make sense for properties)
106
- # Ignore D403 First word of the first line should be properly capitalized (false positive on "MySQL")
107
- # Ignore N818 Exception should be named with an Error suffix
108
- # Ignore D102 Missing docstring in public method (pydocstyle doesn't look for docstrings in super class
109
- # Ignore W505 So that strings in comments aren't split across lines
110
- # https://github.com/PyCQA/pydocstyle/issues/309) TODO: add pylint check? https://github.com/PyCQA/pydocstyle/issues/309#issuecomment-1284142716
111
- ignore = [" W503" , " E501" , " D107" , " D105" , " D415" , " D403" , " N818" , " D102" , " W505" ]
87
+ [tool .ruff .lint ]
88
+ explicit-preview-rules = true
89
+ select = [" A" , " E" , " W" , " F" , " C" , " N" , " D" , " I" , " CPY001" ]
90
+ ignore = [
91
+ # Missing docstring in public method (pydocstyle doesn't look for docstrings in super class
92
+ # https://github.com/PyCQA/pydocstyle/issues/309) TODO: add pylint check? https://github.com/PyCQA/pydocstyle/issues/309#issuecomment-1284142716
93
+ " D102" ,
94
+ " D105" , # Missing docstring in magic method
95
+ " D107" , # Missing docstring in __init__
96
+ " D403" , # First word of the first line should be capitalized (false positive on "MySQL")
97
+ " D415" , # Docstring first line punctuation (doesn't make sense for properties)
98
+ " E501" , # Line too long (because using black creates errors with this)
99
+ " N818" , # Exception name should be named with an Error suffix
100
+ " W505" , # Doc line too long (so that strings in comments aren't split across lines)
101
+ ]
102
+
103
+ [tool .ruff .lint .per-file-ignores ]
112
104
# D100, D101, D102, D103: Ignore missing docstrings in tests
113
- per-file-ignores = [" tests/*:D100,D101,D102,D103,D104" ]
114
- docstring-convention = " google"
105
+ "tests/*" = [" D1" ]
106
+
107
+ [tool .ruff .lint .flake8-copyright ]
115
108
# Check for properly formatted copyright header in each file
116
- copyright-check = " True"
117
- copyright-author = " Canonical Ltd."
118
- copyright-regexp = " Copyright\\ s\\ d{4}([-,]\\ d{4})*\\ s+%(author)s"
109
+ author = " Canonical Ltd."
110
+ notice-rgx = " Copyright\\ s\\ d{4}([-,]\\ d{4})*\\ s+"
111
+
112
+ [tool .ruff .lint .mccabe ]
113
+ max-complexity = 10
114
+
115
+ [tool .ruff .lint .pydocstyle ]
116
+ convention = " google"
0 commit comments