-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only extract the first symbol for equal and left assignments #709
Conversation
Fixes #666 Makes sure foo$bar$duh <- 42L returns "foo" as the only used (global) symbol.
@MichaelChirico Can you check the new XPath? |
fix weird test file indentation
I tried the branch code on the original example code from issue #666:
There was no error any more, which is good. However, I also don't get an error from this code:
I still don't get any lint issues, and I think I should: this code is treating
|
Thanks for checking this out. $- Assignments should be considered a usage of the first object, not an assignment, i.e. assigned symbols should actually only be 1st level SYMBOLs of the LHS of an assignment expression. |
When run on gWidgets source code, I get a couple of object-usage lints using master that aren't lints using this branch and vice-versa (I checked many more packages). These lines are flagged in master (but not 709):
These are flagged in #709 (6a04903) (but not master):
|
Some other examples of object-usage lints that are called by 709 but not master (across 81 packages):
Interestingly none of these seem to relate to |
Corresponding, a sample of the lints called by master but not 709:
All of these sampled lint-diffs are from And for all the 117 (master-not-709) lints, they all had message of the form "no visible binding for global variable ..." |
@dmurdoch I directly checked
with
and even
I've submitted an issue at codetools for this. |
@russHyde Can you re-run the current HEAD of #709? I will manually check
All new lints relate to the |
So the only lints that are 709-specific come from 'aoos', 'shiny' and 'gWidgets2': The shiny ones all relate to the
The aoos ones relate to the operators "%p0%" and "%without%" (I couldn't find their definition)
The gWidgets2 ones are similar:
|
The lints that were thrown using the master branch, but not in 709, had the following frequencies across packages:
These all contain $-subsetting |
The studied packages:
|
@russHyde looks good; thanks again! Did you run |
I loaded lintr using devtools::load_all, but didn't load any of the analysed packages. |
Can you try that for |
@russHyde If you share your script, I can run it myself, too. |
Please see here: https://gist.github.com/russHyde/568fd5af558c860d97e1b932ca773ff7 |
I've confirmed that there are no new lints in All removed lints appear to be false positives in master. |
I came from https://gitlab.com/luke-tierney/codetools/-/issues/3, have you guys found a way to deal with the following not being picked up by
|
Fixes #666
Makes sure foo$bar$duh <- 42L returns "foo" as the only used (global) symbol.