This regular expression
|
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")
This regular expression
madrat/R/getMadratGraph.R
Line 40 in d976b88
fails to see that
calcOutput(GDP)is valid R code (as long asGDPis defined, which it does not check).This leads to false negative warnings for https://github.com/pik-piam/mrcommons/blob/0041fd9d6e6a7e564f7ea10804e31523dec8d792/R/calcGDPppp.R#L20
which is not code but a string too boot.