chore: upgrade black to 26.3.1 and fix code style#251
Conversation
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 <[email protected]>
There was a problem hiding this comment.
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
blackfrom24.3.0to26.3.1inpyproject.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-inall()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.
| "ortools", | ||
| "prettytable", | ||
| "black==24.3.0", | ||
| "black==26.3.1", |
There was a problem hiding this comment.
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.
| "ortools", | ||
| "prettytable", | ||
| "black==24.3.0", | ||
| "black==26.3.1", |
There was a problem hiding this comment.
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.
| ) | ||
|
|
||
|
|
||
| all = [ |
There was a problem hiding this comment.
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).
| all = [ | |
| __all__ = [ |
| import numpy as np | ||
|
|
||
|
|
||
| all = [ |
There was a problem hiding this comment.
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.
| all = [ | |
| __all__ = [ |
Description
This PR upgrades the
blackcode formatter from24.3.0to26.3.1and applies the updated formatting rules across the entire codebase.The newer black version enforces stricter PEP 8 compliance, resulting in these automatic fixes:
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
Checklist
black .command to format the code base.🤖 Generated with Claude Code