Skip to content

[ci] scripts/check_file_size.py only scans git-tracked files, so an oversized untracked file passes make lint until it's committed #204

Description

@antosubash

Summary

scripts/check_file_size.py enumerates files via git ls-files by default, so a new file exceeding the 300-line cap passesmake lint while untracked, then fails only after it's committed (and tracked). This breaks the "green before commit" workflow.

Environment

  • Framework checkout: v0.0.17-5-g2b079c9; smpy / published simple_module_* / @simple-module-py/*: 0.0.17
  • Python 3.12.3, uv 0.11.7, node v24.15.0, Linux (Ubuntu)

Found while building a real consumer app (Invoice Manager) on the framework.

Repro

  1. Create modules/<m>/<m>/big.py with 320 lines; do NOT git add.
  2. make lint → passes ("no files exceed 300 lines") because the untracked file is skipped.
  3. git add -A && git commit; make lint → now fails on big.py.

(Hit in this build: a 338-line data file passed lint pre-commit and failed post-commit.)

Impact / suggestion

Lint result depends on git index state, not the working tree. Suggest scanning the working tree (respecting .gitignore) rather than only tracked files — or at least including untracked-but-not-ignored files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions