Skip to content

Conversation

@Mayankm96
Copy link
Contributor

@Mayankm96 Mayankm96 commented Jan 5, 2026

Description

Another small step towards switching over to ruff.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions bot added bug Something isn't working isaac-mimic Related to Isaac Mimic team infrastructure labels Jan 5, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 5, 2026

Greptile Summary

This PR consolidates flake8 configuration from .flake8 into pyproject.toml as part of the migration towards using ruff. The changes modernize the tooling setup by centralizing configuration and updating VSCode settings to use newer extension APIs.

Key Changes

  • Migrated flake8 settings from .flake8 to [tool.flake8] in pyproject.toml
  • Added Flake8-pyproject dependency to .pre-commit-config.yaml (enables flake8 to read from pyproject.toml)
  • Updated flake8 version from 7.0.0 to 7.1.0
  • Added F403 (unable to detect undefined names) to ignore list
  • Moved black's unstable = true flag from pre-commit args to pyproject.toml
  • Updated VSCode settings to use new extension APIs (black-formatter.args, flake8.enabled)
  • Refactored __init__.py files to use dynamic import strings (f"{__name__}...") instead of direct imports, eliminating F401 violations
  • Minor formatting fix in shadow_hand/__init__.py (changed <h4> to # ---)

Issues Found

  • Exclude pattern narrowed: Changed from _* (all underscore-prefixed paths) to only _isaac_sim/**, which may cause flake8 to lint previously excluded directories like _compiler

Confidence Score: 4/5

  • This PR is safe to merge with one configuration issue that should be addressed
  • The migration is well-executed with proper dependency updates and modern best practices. The exclude pattern issue could cause unexpected linting behavior but won't break functionality. All configuration changes are backward-compatible.
  • pyproject.toml - review the exclude pattern to ensure all intended directories are excluded

Important Files Changed

Filename Overview
pyproject.toml Flake8 configuration migrated from .flake8, added F403 ignore and unstable = true for black, exclude pattern narrowed from _* to _isaac_sim/**
.pre-commit-config.yaml Updated flake8 to 7.1.0, added Flake8-pyproject dependency, removed --unstable arg from black (moved to pyproject.toml)
source/isaaclab_mimic/isaaclab_mimic/envs/init.py Removed unused imports, refactored gym.register to use dynamic string references with f"{__name__}..." to avoid F401 violations
source/isaaclab_mimic/isaaclab_mimic/envs/pinocchio_envs/init.py Removed unused imports, refactored gym.register to use dynamic string references with f"{__name__}..." to avoid F401 violations

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant PreCommit as pre-commit
    participant Black as Black Formatter
    participant Flake8 as Flake8 Linter
    participant PyProject as pyproject.toml
    
    Dev->>PreCommit: git commit
    PreCommit->>Black: Run black formatter
    Black->>PyProject: Read [tool.black] config
    Note over Black,PyProject: line-length=120<br/>unstable=true
    Black-->>PreCommit: Format OK
    
    PreCommit->>Flake8: Run flake8 linter (v7.1.0)
    Flake8->>PyProject: Read [tool.flake8] config via Flake8-pyproject
    Note over Flake8,PyProject: Previously read from .flake8<br/>Now centralized in pyproject.toml
    Flake8->>Flake8: Check Python files
    Note over Flake8: Skip F401 for __init__.py<br/>Use dynamic imports with __name__
    Flake8-->>PreCommit: Linting OK
    
    PreCommit-->>Dev: All checks passed
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Additional Comments (1)

  1. pyproject.toml, line 37-42 (link)

    logic: the exclude pattern changed from _* (which excludes all files/dirs starting with underscore) to only _isaac_sim/**. while docs/** is already included, this might now lint other underscore-prefixed directories like _compiler or __pycache__ that were previously excluded.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@Mayankm96 Mayankm96 requested a review from jtigue-bdai as a code owner January 5, 2026 12:55
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation infrastructure isaac-mimic Related to Isaac Mimic team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant