Skip to content

Conversation

@Mayankm96
Copy link
Contributor

@Mayankm96 Mayankm96 commented Jan 13, 2026

Description

Fixes #4372

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 documentation Improvements or additions to documentation infrastructure labels Jan 13, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 13, 2026

Greptile Overview

Greptile Summary

Overview

This PR fixes template project creation by removing the reference to the deleted .flake8 file. In PR #4335, the .flake8 file was removed and its configuration was moved to pyproject.toml. However, the template generator was still trying to copy the non-existent .flake8 file, causing project generation to fail.

Changes Made

  1. tools/template/generator.py: Removed line attempting to copy .flake8 from root directory
  2. .github/labeler.yml: Removed .flake8 from infrastructure label file patterns
  3. docs/source/overview/developer-guide/repo_structure.rst: Removed .flake8 from documentation tree structure

Critical Issue Found

While the PR correctly addresses the immediate error, it creates an incomplete migration from .flake8 to pyproject.toml:

Problem: Generated external projects will now have:

  • .pre-commit-config.yaml (with Flake8-pyproject dependency expecting config in pyproject.toml)
  • ❌ NO root pyproject.toml (never copied, only minimal extension pyproject.toml at source/<name>/pyproject.toml)
  • ❌ NO .flake8 file (correctly removed in this PR)

Impact: Flake8 will run with default strict settings instead of the project's custom configuration (ignoring E501 line length, F401 in __init__.py, etc.), potentially causing false positives and inconsistent code style.

Additional Issue

The VSCode settings template (tools/template/templates/external/.vscode/tools/settings.template.json) uses outdated flake8 configuration format and doesn't reference pyproject.toml.

Recommendation

This PR needs to also copy the root pyproject.toml to generated projects to complete the migration from .flake8 to pyproject.toml-based configuration.

Confidence Score: 2/5

  • This PR fixes the immediate error but introduces a configuration gap that will affect generated projects
  • The changes are syntactically correct and address the immediate issue (copying non-existent .flake8 file). However, the PR is incomplete - it removes the old configuration mechanism without ensuring the new one (pyproject.toml) is in place for generated projects. This will cause flake8 to run with default settings in generated projects, leading to inconsistent linting behavior and potential CI failures. The missing root pyproject.toml copy is a critical logical error that needs to be fixed before merge.
  • Pay close attention to tools/template/generator.py - it needs to copy the root pyproject.toml file to complete the migration from .flake8 to pyproject.toml-based configuration. Also review tools/template/templates/external/.vscode/tools/settings.template.json for VSCode settings consistency.

Important Files Changed

File Analysis

Filename Score Overview
tools/template/generator.py 2/5 Correctly removes .flake8 copy, but missing root pyproject.toml copy needed for flake8 config
.github/labeler.yml 5/5 Correctly removes .flake8 from infrastructure label triggers
docs/source/overview/developer-guide/repo_structure.rst 5/5 Correctly removes .flake8 from repository structure documentation

Sequence Diagram

sequenceDiagram
    participant User
    participant Generator as generator.py
    participant FS as File System
    participant PreCommit as pre-commit hooks
    
    User->>Generator: Request external project creation
    Generator->>FS: Copy .dockerignore from ROOT_DIR
    Generator->>FS: Copy .gitattributes from ROOT_DIR
    Generator->>FS: Copy .gitignore from ROOT_DIR (if exists)
    Note over Generator,FS: ❌ Missing: Copy pyproject.toml from ROOT_DIR
    Generator->>FS: Copy .pre-commit-config.yaml from ROOT_DIR
    Note right of FS: .pre-commit-config.yaml<br/>includes Flake8-pyproject<br/>which expects pyproject.toml!
    Generator->>FS: Copy scripts with RL libraries
    Generator->>FS: Create extension files
    Generator->>FS: Copy extension/pyproject.toml to source/<name>/
    Note right of FS: This pyproject.toml is minimal,<br/>only for build system,<br/>NOT for flake8 config!
    Generator->>FS: Setup git repository
    Generator-->>User: Project created
    
    User->>PreCommit: Run pre-commit hooks
    PreCommit->>FS: Look for flake8 config in pyproject.toml
    FS-->>PreCommit: ❌ pyproject.toml not found in root
    PreCommit->>PreCommit: Use flake8 defaults (strict rules)
    Note over PreCommit: No custom ignores (E501, F401, etc.)<br/>May cause unexpected linting errors!
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.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 13, 2026

Additional Comments (2)

tools/template/generator.py
The removal of the .flake8 copy is correct, but now generated external projects will lack flake8 configuration entirely.

Problem: The .pre-commit-config.yaml (line 168) is copied with Flake8-pyproject dependency, which expects flake8 config in pyproject.toml. However, the root pyproject.toml is never copied to generated projects (only the extension's minimal pyproject.toml at line 235 is copied to source/<name>/pyproject.toml).

Impact: Generated external projects will run flake8 via pre-commit hooks without any custom configuration, using flake8's strict defaults instead of the project's intended rules (like ignoring E501 for line length, F401 for init.py, etc.).

Solution: Add a line to copy the root pyproject.toml:

    shutil.copyfile(os.path.join(ROOT_DIR, ".dockerignore"), os.path.join(project_dir, ".dockerignore"))
    shutil.copyfile(os.path.join(ROOT_DIR, ".gitattributes"), os.path.join(project_dir, ".gitattributes"))
    if os.path.exists(os.path.join(ROOT_DIR, ".gitignore")):
        shutil.copyfile(os.path.join(ROOT_DIR, ".gitignore"), os.path.join(project_dir, ".gitignore"))
    shutil.copyfile(os.path.join(ROOT_DIR, "pyproject.toml"), os.path.join(project_dir, "pyproject.toml"))
    shutil.copyfile(

tools/template/templates/external/.vscode/tools/settings.template.json
The VSCode flake8 configuration is outdated and inconsistent with the main repository's settings.

Problem: This template still uses the old python.linting.flake8Enabled and python.linting.flake8Args format. However, the main repository now uses the newer format that references pyproject.toml for flake8 configuration (see docs/source/overview/developer-guide/vs_code.rst lines 89-90).

Current main repo settings:

"flake8.enabled": true,
"flake8.args": ["--config", "${workspaceFolder}/pyproject.toml"],

Impact: Generated projects will have inconsistent VSCode settings and won't properly use the flake8 configuration from pyproject.toml.

Solution: Update to match the main repository's format:

    // Use flake8 for linting
    "python.linting.pylintEnabled": false,
    "flake8.enabled": true,
    "flake8.args": ["--config", "${workspaceFolder}/pyproject.toml"],

@Mayankm96 Mayankm96 merged commit 7787376 into main Jan 13, 2026
8 checks passed
@Mayankm96 Mayankm96 deleted the fix/flake8-template branch January 13, 2026 10:30
Edify0991 pushed a commit to Edify0991/IsaacLab that referenced this pull request Jan 14, 2026
# Description

Fixes isaac-sim#4372

## Type of change

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

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] .flake8 Not found when Create Project

2 participants