Skip to content

Commit ec58ff2

Browse files
Use ruff formatter in DABs templates (replacing Black) (#4196)
## Changes This switches the code formatter to ruff and sets the line length to 120 a described in #3675. ## Why * ruff mindshare, performance, and ability to combine linting and formatting ## Tests * Standard acceptance tests --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent 6fbc7af commit ec58ff2

File tree

18 files changed

+28
-22
lines changed

18 files changed

+28
-22
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ To disable this, set the environment variable DATABRICKS_CACHE_ENABLED to false.
1212
* Enable caching user identity by default ([#4202](https://github.com/databricks/cli/pull/4202))
1313
* Fix false positive folder permission warnings and make them more actionable ([#4216](https://github.com/databricks/cli/pull/4216))
1414
* Pass additional Azure DevOps system variables ([#4236](https://github.com/databricks/cli/pull/4236))
15+
* Replace Black formatter with Ruff in Python bundle templates for faster, all-in-one linting and formatting ([#4196](https://github.com/databricks/cli/pull/4196))
1516

1617
### Dependency updates
1718

acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"recommendations": [
33
"databricks.databricks",
44
"redhat.vscode-yaml",
5-
"ms-python.black-formatter"
5+
"charliermarsh.ruff"
66
]
77
}

acceptance/bundle/templates/default-minimal/output/my_default_minimal/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"python.testing.unittestEnabled": false,
3434
"python.testing.pytestEnabled": true,
3535
"[python]": {
36-
"editor.defaultFormatter": "ms-python.black-formatter",
36+
"editor.defaultFormatter": "charliermarsh.ruff",
3737
"editor.formatOnSave": true,
3838
},
3939
}

acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"recommendations": [
33
"databricks.databricks",
44
"redhat.vscode-yaml",
5-
"ms-python.black-formatter"
5+
"charliermarsh.ruff"
66
]
77
}

acceptance/bundle/templates/default-python/classic/output/my_default_python/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"python.testing.unittestEnabled": false,
3434
"python.testing.pytestEnabled": true,
3535
"[python]": {
36-
"editor.defaultFormatter": "ms-python.black-formatter",
36+
"editor.defaultFormatter": "charliermarsh.ruff",
3737
"editor.formatOnSave": true,
3838
},
3939
}

acceptance/bundle/templates/default-python/classic/output/my_default_python/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies = [
1414
[dependency-groups]
1515
dev = [
1616
"pytest",
17+
"ruff",
1718
"databricks-dlt",
1819
"databricks-connect>=15.4,<15.5",
1920
"ipykernel",
@@ -26,5 +27,5 @@ main = "my_default_python.main:main"
2627
requires = ["hatchling"]
2728
build-backend = "hatchling.build"
2829

29-
[tool.black]
30-
line-length = 125
30+
[tool.ruff]
31+
line-length = 120

acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"recommendations": [
33
"databricks.databricks",
44
"redhat.vscode-yaml",
5-
"ms-python.black-formatter"
5+
"charliermarsh.ruff"
66
]
77
}

acceptance/bundle/templates/default-python/serverless/output/my_default_python/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"python.testing.unittestEnabled": false,
3434
"python.testing.pytestEnabled": true,
3535
"[python]": {
36-
"editor.defaultFormatter": "ms-python.black-formatter",
36+
"editor.defaultFormatter": "charliermarsh.ruff",
3737
"editor.formatOnSave": true,
3838
},
3939
}

acceptance/bundle/templates/default-python/serverless/output/my_default_python/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies = [
1414
[dependency-groups]
1515
dev = [
1616
"pytest",
17+
"ruff",
1718
"databricks-dlt",
1819
"databricks-connect>=15.4,<15.5",
1920
"ipykernel",
@@ -26,5 +27,5 @@ main = "my_default_python.main:main"
2627
requires = ["hatchling"]
2728
build-backend = "hatchling.build"
2829

29-
[tool.black]
30-
line-length = 125
30+
[tool.ruff]
31+
line-length = 120

acceptance/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"recommendations": [
33
"databricks.databricks",
44
"redhat.vscode-yaml",
5-
"ms-python.black-formatter"
5+
"charliermarsh.ruff"
66
]
77
}

0 commit comments

Comments
 (0)