Skip to content

chore: upgrade black to 26.3.1 and fix code style#251

Merged
yuecideng merged 1 commit intomainfrom
chore/upgrade-black-and-fix-style
Apr 30, 2026
Merged

chore: upgrade black to 26.3.1 and fix code style#251
yuecideng merged 1 commit intomainfrom
chore/upgrade-black-and-fix-style

Conversation

@yuecideng
Copy link
Copy Markdown
Contributor

Description

This PR upgrades the black code formatter from 24.3.0 to 26.3.1 and applies the updated formatting rules across the entire codebase.

The newer black version enforces stricter PEP 8 compliance, resulting in these automatic fixes:

  • Removed extra blank lines between imports and top-level definitions (47 files)
  • Trimmed trailing whitespace in docstrings and comments (3 files)
  • Added blank line after module docstring in docs/sync_readme.py (black formatting requirement)

No functional changes — purely formatting/style updates to stay current with the latest black release.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

🤖 Generated with Claude Code

Upgrade black formatter from 24.3.0 to 26.3.1 and apply the new
formatting rules across the codebase. The new version enforces
stricter PEP 8 compliance by removing extra blank lines between
imports and top-level definitions, and trimming trailing whitespace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 30, 2026 04:33
@yuecideng yuecideng added ci dependencies Pull requests that update a dependency file refactor labels Apr 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Python formatter (black) version and applies the resulting formatting changes (mostly whitespace/blank-line/docstring cleanup) across the repository to keep style enforcement consistent with the newer formatter.

Changes:

  • Bump black from 24.3.0 to 26.3.1 in pyproject.toml.
  • Apply black-driven formatting updates across tests, examples, scripts, and library modules (primarily removing stray whitespace-only blank lines and trimming trailing whitespace).
  • Add a required blank line after the module docstring in docs/sync_readme.py.

Reviewed changes

Copilot reviewed 46 out of 48 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/sim/sensors/test_stereo.py Remove whitespace-only blank line per formatter output
tests/sim/sensors/test_camera.py Remove whitespace-only blank line per formatter output
tests/sim/objects/test_robot.py Remove whitespace-only blank line per formatter output
tests/gym/envs/managers/test_dataset_functors.py Remove whitespace-only blank line per formatter output
tests/common.py Remove whitespace-only blank line per formatter output
scripts/tutorials/sim/export_usd.py Trim trailing whitespace in docstring
scripts/benchmark/rl/runtime.py Remove whitespace-only blank line per formatter output
scripts/benchmark/rl/plots.py Remove whitespace-only blank line per formatter output
scripts/benchmark/rl/config.py Remove whitespace-only blank line per formatter output
pyproject.toml Upgrade pinned black version
examples/sim/utility/workspace_analyzer/analyze_plane_workspace.py Remove whitespace-only blank line per formatter output
examples/agents/datasets/online_dataset_demo.py Trim trailing whitespace in docstring usage block
embodichain/utils/warp/kinematics/opw_solver.py Remove whitespace-only blank line per formatter output
embodichain/utils/configclass.py Remove whitespace-only blank line per formatter output
embodichain/utils/init.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/visualizers/voxel_visualizer.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/visualizers/sphere_visualizer.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/visualizers/base_visualizer.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/samplers/base_sampler.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/constraints/workspace_constraint.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/constraints/base_constraint.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/configs/init.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/caches/cache_manager.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/utility/workspace_analyzer/caches/base_cache.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/types.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/solvers/pinocchio_solver.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/solvers/opw_solver.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/solvers/differential_solver.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/robots/dexforce_w1/utils.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/planners/utils.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/planners/motion_generator.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/objects/gizmo.py Remove whitespace-only blank line per formatter output
embodichain/lab/sim/atom_actions.py Remove whitespace-only blank line per formatter output
embodichain/lab/scripts/run_agent.py Remove whitespace-only blank line per formatter output
embodichain/lab/gym/envs/tasks/tableware/pour_water/action_bank.py Remove whitespace-only blank line per formatter output
embodichain/lab/gym/envs/managers/randomization/spatial.py Remove whitespace-only blank line per formatter output
embodichain/lab/gym/envs/managers/randomization/physics.py Remove whitespace-only blank line per formatter output
embodichain/lab/gym/envs/embodied_env.py Remove whitespace-only blank line per formatter output
embodichain/lab/gym/envs/action_bank/utils.py Remove whitespace-only blank line per formatter output
embodichain/data/assets/scene_assets.py Remove whitespace-only blank line per formatter output
embodichain/data/assets/robot_assets.py Remove whitespace-only blank line per formatter output
embodichain/data/assets/obj_assets.py Remove whitespace-only blank line per formatter output
embodichain/data/assets/materials.py Remove whitespace-only blank line per formatter output
embodichain/data/assets/eef_assets.py Remove whitespace-only blank line per formatter output
embodichain/agents/rl/models/mlp.py Remove whitespace-only blank line per formatter output
embodichain/agents/datasets/sampler.py Remove whitespace-only blank line per formatter output
embodichain/agents/datasets/online_data.py Remove whitespace-only blank line per formatter output
docs/sync_readme.py Add blank line after module docstring per formatter requirement
Comments suppressed due to low confidence (1)

embodichain/lab/sim/robots/dexforce_w1/utils.py:40

  • This module defines all = [...] instead of __all__ = [...]. That shadows the built-in all() and won’t affect star-import exports; if the intent is to declare public symbols, this should be __all__ (consistent with other modules in the repo).
all = [
    "ChassisManager",
    "TorsoManager",
    "HeadManager",
    "ArmManager",
    "HandManager",
    "EyesManager",
    "build_dexforce_w1_assembly_urdf_cfg",
    "build_dexforce_w1_cfg",
]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
"ortools",
"prettytable",
"black==24.3.0",
"black==26.3.1",
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

black is being upgraded here, but CI still pins black==24.3.0 (see .github/workflows/main.yml). That mismatch can cause the style-check job to fail if formatting changes between versions. Update the workflow (or otherwise centralize the version) to keep the formatter version consistent with this dependency pin.

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml
"ortools",
"prettytable",
"black==24.3.0",
"black==26.3.1",
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

black is listed in [project].dependencies, meaning it will be installed for all consumers of the package. Since there are no imports/usages of black in the codebase, it looks like a dev-only tool and would be better placed under an optional dev/lint extra (or a dedicated dev requirements file) to avoid inflating runtime installs.

Copilot uses AI. Check for mistakes.
)


all = [
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

This module defines all = [...] instead of __all__ = [...]. That both shadows Python’s built-in all() and won’t control star-import exports as intended. Rename this to __all__ (and keep it consistent with the many other modules using __all__ in this repo).

Suggested change
all = [
__all__ = [

Copilot uses AI. Check for mistakes.
import numpy as np


all = [
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

This module defines all = [...] instead of __all__ = [...]. That shadows the built-in all() and also won’t affect from module import * exports. Rename to __all__ to match standard Python semantics and the convention used elsewhere in the repository.

Suggested change
all = [
__all__ = [

Copilot uses AI. Check for mistakes.
@yuecideng yuecideng merged commit 72b5bb9 into main Apr 30, 2026
8 checks passed
@yuecideng yuecideng deleted the chore/upgrade-black-and-fix-style branch April 30, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci dependencies Pull requests that update a dependency file refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants