Skip to content

fix(linter): avoid VAR13 shadowing false positives - #1870

Open
bhirsz wants to merge 1 commit into
mainfrom
fix-var13-shadowing
Open

fix(linter): avoid VAR13 shadowing false positives#1870
bhirsz wants to merge 1 commit into
mainfrom
fix-var13-shadowing

Conversation

@bhirsz

@bhirsz bhirsz commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

  • match automatic variables by exact identifier and normalized name, excluding environment variables and unsupported list forms
  • suppress VAR13 when reserved names are statically shadowed by Variables-section bindings, assignments, VAR, or BuiltIn Set ... Variable calls
  • model setup/teardown runtime ordering conservatively and prevent local bindings from leaking between tests
  • add RF 5/6/7 regressions for ordering, scope, item/typed assignments, nested ranges, setters, and delayed teardown contexts

Validation

  • uv run pytest -q tests\linter\rules\variables (55 passed, 15 skipped)
  • exact Robot Framework 5.0.1, 6.1.1, 7.0.1, and 7.3.2 VAR13 runs
  • uv run ruff check
  • uv run ruff format --check
  • uv run mypy --config-file=pyproject.toml .\src\robocop\
  • independent review, with setup and suite-setup ordering findings addressed

Follow-up to #1867.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@bhirsz bhirsz mentioned this pull request Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant