@@ -71,44 +71,50 @@ python-packages = ["pendulum"]
7171
7272[tool .ruff ]
7373fix = true
74- unfixable = [
75- " ERA" , # do not autoremove commented out code
76- ]
77- target-version = " py39"
7874line-length = 88
75+ target-version = " py39"
76+ extend-exclude = [
77+ # External to the project's coding standards:
78+ " docs/*" ,
79+ # Machine-generated, too many false-positives
80+ " src/pendulum/locales/*" ,
81+ # ruff disagrees with black when it comes to formatting
82+ " *.pyi" ,
83+ ]
84+
85+ [tool .ruff .lint ]
7986extend-select = [
80- " B" , # flake8-bugbear
81- " C4" , # flake8-comprehensions
87+ " B" , # flake8-bugbear
88+ " C4" , # flake8-comprehensions
8289 " ERA" , # flake8-eradicate/eradicate
83- " I" , # isort
84- " N" , # pep8-naming
90+ " I" , # isort
91+ " N" , # pep8-naming
8592 " PIE" , # flake8-pie
8693 " PGH" , # pygrep
8794 " RUF" , # ruff checks
8895 " SIM" , # flake8-simplify
96+ " T20" , # flake8-print
8997 " TCH" , # flake8-type-checking
9098 " TID" , # flake8-tidy-imports
91- " UP" , # pyupgrade
99+ " UP" , # pyupgrade
92100]
93101ignore = [
94102 " B904" , # use 'raise ... from err'
95103 " B905" , # use explicit 'strict=' parameter with 'zip()'
96- " N818" , # Exception name should be named with an Error suffix
97- " RUF001" ,
104+ " N818" ,
105+ " RUF001"
98106]
99- extend-exclude = [
100- # External to the project's coding standards:
101- " docs/*" ,
102- # Machine-generated, too many false-positives
103- " src/pendulum/locales/*" ,
104- # ruff disagrees with black when it comes to formatting
105- " *.pyi" ,
107+ extend-safe-fixes = [
108+ " TCH" , # move import from and to TYPE_CHECKING blocks
109+ ]
110+ unfixable = [
111+ " ERA" , # do not autoremove commented out code
106112]
107113
108- [tool .ruff .flake8-tidy-imports ]
114+ [tool .ruff .lint . flake8-tidy-imports ]
109115ban-relative-imports = " all"
110116
111- [tool .ruff .isort ]
117+ [tool .ruff .lint . isort ]
112118force-single-line = true
113119lines-between-types = 1
114120lines-after-imports = 2
@@ -122,7 +128,7 @@ known-third-party = [
122128]
123129required-imports = [" from __future__ import annotations" ]
124130
125- [tool .ruff .extend-per-file-ignores ]
131+ [tool .ruff .lint . extend-per-file-ignores ]
126132"build.py" = [" I002" ]
127133"clock" = [" RUF012" ]
128134
0 commit comments