Repository navigation
Conversation
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
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refines Wright's existing
nested-binder-lambdalint warning for theany([...])insidefilter(lambda p: ...)pattern reported in #1032. The diagnostic identifies the inner and outer iterators, namesCurrent 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 pinnedLPP_MOCK_PROVIDER).git diff --checkand the repository size guard: passed.wright check,lint,analyze,inspect, andcompileon a scratch OPY reproduction using installed OPY provider 0.3.27 and the expression from the issue, in bothen-USandzh-CN. All completed successfully; lint reports exactly one warning mapped to the original OPY source in each locale.reproducer-bastion-prophet.wsand acceptedbastion.owfixtures. 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