posit-dev / ark

Ark, an R kernel
MIT License
177 stars 15 forks source link

Detect assignments in calls to avoid false positive lints #639

Open lionel- opened 1 day ago

lionel- commented 1 day ago

Addresses posit-dev/positron#3048.

Positron Notes

Release Notes

New Features

Bug Fixes

QA Notes

Assignments in calls, e.g. list(x <- 1) should now be treated the same as at top-level. Any further references to x at top level should not be linted, e.g. y should cause a lint but not x in:

list(x <- 1)
x; y

Note that calls can be nested list(x <- 1, list(y, x, y <- 2), 1, y).

In that example, the first y should in principle be linted as it hasn't been defined yet but we don't support this sort of lints inside arguments yet.