-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
Description
This regular expression
Line 40 in d976b88
| pattern <- "(readSource|calcOutput)\\( *([^=\"',]*=|) *(\"|')?([^\"',]*)[\"']?" |
fails to see that
calcOutput(GDP) is valid R code (as long as GDP is defined, which it does not check).
> stringi::stri_match_all_regex("calcOutput(GDP)", "(readSource|calcOutput)\\( *([^=\"',]*=|) *(\"|')?([^\"',]*)[\"']?")
[[1]]
[,1] [,2] [,3] [,4] [,5]
[1,] "calcOutput(GDP)" "calcOutput" "" NA "GDP)"
This leads to false negative warnings for https://github.com/pik-piam/mrcommons/blob/0041fd9d6e6a7e564f7ea10804e31523dec8d792/R/calcGDPppp.R#L20
warning("calcGDPppp() is deprecated. Returning default 'calcOutput(GDP)' output instead. Please use mrdrivers::calcGDP() directly.")
which is not code but a string too boot.
~ WARNING: Following functions contain read or calc statements which could not be identified:
~ calcGDPppp
Please adress the type explicitly in the call to allow
~ for proper detection, e.g. readSource("MySource")
Reactions are currently unavailable