Skip to content

fix(lint): diagnose nested Current Array Element scope - #1033

Closed
e54-bot wants to merge 1 commit into
mainfrom
impl/1032
Closed

e54-bot wants to merge 1 commit into
mainfrom
impl/1032

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Refines Wright's existing nested-binder-lambda lint warning for the any([...]) inside filter(lambda p: ...) pattern reported in #1032. The diagnostic identifies the inner and outer iterators, names Current Array Element / Current Array Index, and explicitly says that the exact client limit is unconfirmed.

The rule now requires a binding read in the nested iterator's array source or its own per-element arguments. It suppresses calls with no such read and avoids attributing a deeper iterator's per-element reads to its parent. Existing rule configuration, source locations, disabled-code handling, and warning severity remain in use. OPY lowering is unchanged; this implements option 1 only.

Verification:

  • cargo fmt --all -- --check: passed.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: passed.
  • cargo test --workspace --all-targets --all-features </dev/null: passed (818 passed, 0 failed; 17 pre-existing tests ignored because they require the separately built pinned LPP_MOCK_PROVIDER).
  • git diff --check and the repository size guard: passed.
  • New analyzer coverage exercises every pair of the five iterator forms, element/index reads, source-only reads, no-read negatives, and deeper scopes. CLI coverage checks the reported pattern, source location, severity override, disablement, source-array chaining, and non-nested aggregation.
  • Compared the same CLI input with installed Wright 0.39.2 and the updated binary: the released binary reports two warnings, including a nested call with no binding read; the updated binary reports only the relevant warning. Wright 0.39.2 already warns on the minimized OPY expression, so this change refines and protects an existing diagnostic rather than introducing a second rule.
  • Ran wright check, lint, analyze, inspect, and compile on a scratch OPY reproduction using installed OPY provider 0.3.27 and the expression from the issue, in both en-US and zh-CN. All completed successfully; lint reports exactly one warning mapped to the original OPY source in each locale.
  • Ran the same five workflows on the pinned reproducer-bastion-prophet.ws and accepted bastion.ow fixtures. Both complete successfully; the prophet reproducer retains all 16 nested-binding warnings and the accepted fixture has none. These fixtures retain their existing immutable provenance and licensing metadata.

Ablation: reused the existing lint rule instead of adding a new rule or configuration mechanism, removed duplicate CLI regression coverage, and simplified the existing scope propagation. New tests live in feature-specific files to respect the no-growth guard on oversized files.

Unverified: no Overwatch client was available to import the generated scripts. The exact client nesting/shared-binding limit remains unconfirmed; this is a static-indicator warning, not a validated importability boundary. The original full-project zero-finding result was not reproduced: the complete current Bastion source project was not rebuilt, and validation used the issue's OPY expression and the existing pinned Workshop artifacts. The 17 ignored mock-provider tests were not run; no LPP behavior changed. No UI files changed, so UI gates do not apply. Remote CI is pending.

Fixes #1032

Refine the existing nested-binder-lambda warning to require an element or
index read in the nested iterator's source or per-element arguments. Keep
reads confined to deeper iterator bodies from creating redundant warnings,
and explain the unconfirmed client import risk in diagnostics and docs.

Cover all iterator pairs, source-only reads, deeper scopes, CLI locations,
severity overrides, and rule disablement without changing OPY lowering.

Fixes #1032
@e54-bot

e54-bot commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: this narrows the existing nested-binder-lambda rule and does not deliver the owner decision on #1032 (compile/check must report lint findings). Redone on a new branch.

@e54-bot e54-bot closed this Oct 30, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Make Workshop Great Again Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Detect nested Current Array Element scope (any([...]) inside a filter lambda) that the Workshop client rejects

2 participants