Skip to content

Use Ruff formatter in devcontainer config#3737

Merged
vfdev-5 merged 4 commits intopytorch:masterfrom
zeel2104:fix/devcontainer-ruff-formatter
Apr 15, 2026
Merged

Use Ruff formatter in devcontainer config#3737
vfdev-5 merged 4 commits intopytorch:masterfrom
zeel2104:fix/devcontainer-ruff-formatter

Conversation

@zeel2104
Copy link
Copy Markdown
Contributor

Fixes #3736

Description:

  • Replace ms-python.black-formatter with astral-sh.ruff in .devcontainer/devcontainer.json
  • Set Ruff as the default formatter for Python files in VS Code devcontainer settings
  • Remove the remaining Black-specific formatter configuration

Check list:

  • New tests are added (if a new feature is added)
  • New doc strings: description and/or example code are in RST format
  • Documentation is updated (if required)

Copy link
Copy Markdown
Collaborator

@aaishwarymishra aaishwarymishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I listed wrong extension id in the issue.

Comment thread .devcontainer/devcontainer.json Outdated
"ms-python.python",
"charliermarsh.ruff",
"ms-python.black-formatter"
"astral-sh.ruff"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"astral-sh.ruff"
"charliermarsh.ruff"

Comment thread .devcontainer/devcontainer.json Outdated
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "astral-sh.ruff"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"editor.defaultFormatter": "astral-sh.ruff"
"editor.defaultFormatter": "charliermarsh.ruff"

@aaishwarymishra
Copy link
Copy Markdown
Collaborator

I just noticed that there are few settings for black in the project.toml we should port those settings to ruff format too.

@zeel2104
Copy link
Copy Markdown
Contributor Author

Updated the PR to use the requested Ruff extension ID, removed the stale Black formatter config from pyproject.toml, and updated contributor docs to reference Ruff formatting.

@aaishwarymishra
Copy link
Copy Markdown
Collaborator

formatting is not correct, I think you forgot to run pre-commit hook

@zeel2104
Copy link
Copy Markdown
Contributor Author

Ran pre-commit and pushed the formatting fix in 1efd74f. Waiting on workflow approval for CI to rerun.

@aaishwarymishra
Copy link
Copy Markdown
Collaborator

@vfdev-5 I think this can be merged.

@vfdev-5 vfdev-5 added this pull request to the merge queue Apr 15, 2026
Comment thread CONTRIBUTING.md Outdated
@vfdev-5 vfdev-5 removed this pull request from the merge queue due to a manual request Apr 15, 2026
@vfdev-5 vfdev-5 enabled auto-merge April 15, 2026 20:07
@vfdev-5 vfdev-5 added this pull request to the merge queue Apr 15, 2026
Merged via the queue into pytorch:master with commit c0ceca5 Apr 15, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating .devcontainer/devcontainer.json to use ruff for formatting instead of the black.

3 participants