ropensci / spelling

Tools for Spell Checking in R
https://docs.ropensci.org/spelling
Other
107 stars 25 forks source link

Partial matching issue with `pkg$author` #2

Closed jimhester closed 5 years ago

jimhester commented 6 years ago

https://github.com/ropensci/spelling/blob/7f5e3f6904508ea42d61e7f3c0af2d866e7e5517/R/spell-check.R#L33

will return the author@R term if author does not exist due to partial matching of $. This should be changed to pkg[["author"]] and additional code added to parse the author@R separately.

jeroen commented 5 years ago

Can I parse any field that is postfixed with @R using parse(text = field) ?

jimhester commented 5 years ago

Maybe consider using desc to handle the DESCRIPTION parsing in spelling? It has code to handle Authors@R already, and also handles the encoding and other issues.

I think Authors@R is just special case in base R, there is no arbitrary support for '@R' suffixes.

jeroen commented 5 years ago

Read your comment too late, I've already implemented it myself now. I think eval(parse()) works fine in this case, because we're only using the author field to add it to the ignore list.