Skip to content

Commit 330859c

Browse files
feat: use ruff-format over black
1 parent 3d5a9f3 commit 330859c

File tree

2 files changed

+12
-49
lines changed

2 files changed

+12
-49
lines changed

hatch.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
detached = true
33
python = "3.10"
44
dependencies = [
5-
"black==23.10.1",
65
"click==8.1.7",
76
"cython-lint==0.15.0",
87
"codespell==2.4.1",
@@ -27,7 +26,7 @@ dependencies = [
2726

2827
[envs.lint.scripts]
2928
black_check = [
30-
"black --check {args:.}",
29+
"ruff format {args:.}",
3130
]
3231
cmakeformat_check = [
3332
"bash scripts/cmake-format.sh"
@@ -43,7 +42,7 @@ style = [
4342
"cmakeformat_check",
4443
]
4544
fmt = [
46-
"black {args:.}",
45+
"ruff format {args:.}",
4746
"ruff check --fix {args:.}",
4847
"style",
4948
]

pyproject.toml

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -100,47 +100,6 @@ exclude = '''
100100
)
101101
'''
102102

103-
[tool.black]
104-
line-length = 120
105-
target_version = ['py39', 'py310', 'py311', 'py312']
106-
include = '''\.py[ix]?$'''
107-
exclude = '''
108-
(
109-
\.worktrees/
110-
| .venv*
111-
| \.sg
112-
| \.riot/
113-
| ddtrace/appsec/_ddwaf.pyx$
114-
| ddtrace/internal/_encoding.pyx$
115-
| ddtrace/internal/_rand.pyx$
116-
| ddtrace/internal/_tagset.pyx$
117-
| ddtrace/internal/telemetry/metrics_namespaces.pyx$
118-
| ddtrace/profiling/collector/_traceback.pyx$
119-
| ddtrace/profiling/collector/_task.pyx$
120-
| ddtrace/profiling/_threading.pyx$
121-
| ddtrace/profiling/collector/stack.pyx$
122-
| ddtrace/profiling/exporter/pprof.pyx$
123-
| ddtrace/internal/datadog/profiling/ddup/_ddup.pyx$
124-
| ddtrace/vendor/
125-
| ddtrace/appsec/_iast/_taint_tracking/_vendor/
126-
| ddtrace/appsec/_iast/_taint_tracking/cmake-build-debug/
127-
| ddtrace/_version.py
128-
| \.eggs
129-
| \.git
130-
| \.hg
131-
| \.mypy_cache
132-
| \.nox
133-
| \.tox
134-
| \.venv
135-
| _build/
136-
| buck-out/
137-
| build/
138-
| dist/
139-
| tests/lib-injection/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py$
140-
| tests/profiling/collector/pprof_.*_pb2.py$
141-
)
142-
'''
143-
144103
[tool.pyright]
145104
exclude = [
146105
"**/__pycache__",
@@ -173,6 +132,7 @@ exclude_dirs = [
173132
]
174133

175134
[tool.ruff]
135+
# This exclude list applies to both linting and formatting
176136
exclude = [
177137
".riot",
178138
".ddriot",
@@ -225,6 +185,15 @@ lint.ignore = [
225185
]
226186
line-length = 120
227187

188+
[tool.ruff.format]
189+
# Formatter-specific settings
190+
# The exclude list from [tool.ruff] is inherited automatically
191+
# Additional formatter options can be added here if needed
192+
quote-style = "double"
193+
indent-style = "space"
194+
skip-magic-trailing-comma = false
195+
line-ending = "auto"
196+
228197
# Allow experimental/preview checks
229198
lint.preview = true
230199
lint.explicit-preview-rules = true
@@ -252,8 +221,3 @@ lines-after-imports = 2
252221
force-sort-within-sections = true
253222
known-first-party = [ "ddtrace" ]
254223
relative-imports-order = "furthest-to-closest"
255-
256-
[tool.ruff.lint.per-file-ignores]
257-
# Exclude typing stubs as vertical line spacing incompatibility with black
258-
# See: https://github.com/astral-sh/ruff/pull/6501
259-
"*.pyi" = ["I001"]

0 commit comments

Comments
 (0)