insightsengineering / teal.data

Data model for teal applications
https://insightsengineering.github.io/teal.data/
Other
8 stars 7 forks source link

304 nested functions definition `get_code` detection #305

Closed m7pr closed 5 months ago

m7pr commented 5 months ago

Close #304

library(teal.data)
code = "
  add <- function(a) function(b) a + b
  iris <- iris
"
tdata <- teal_data(code = code)
cat(get_code(tdata, datanames = 'add'))
warning('Code was not verified for reproducibility.')
add <- function(a) function(b) a + b
github-actions[bot] commented 5 months ago

badge

Code Coverage Summary

Filename                         Stmts    Miss  Cover    Missing
-----------------------------  -------  ------  -------  --------------------
R/cdisc_data.R                       1       0  100.00%
R/deprecated.R                      57      57  0.00%    19-344
R/dummy_function.R                   2       2  0.00%    14-15
R/formatters_var_labels.R           61       0  100.00%
R/join_key.R                        38       0  100.00%
R/join_keys-c.R                     12       0  100.00%
R/join_keys-extract.R              128       0  100.00%
R/join_keys-names.R                 15       0  100.00%
R/join_keys-parents.R               30       0  100.00%
R/join_keys-print.R                 45       0  100.00%
R/join_keys-utils.R                 73       3  95.89%   35-38
R/join_keys.R                       21       0  100.00%
R/teal_data-class.R                 25       1  96.00%   69
R/teal_data-datanames.R             10       0  100.00%
R/teal_data-get_code.R              14       0  100.00%
R/teal_data-show.R                   4       4  0.00%    14-19
R/teal_data.R                       30      16  46.67%   33, 36-42, 52-58, 61
R/testhat-helpers.R                 26       0  100.00%
R/topological_sort.R                32       0  100.00%
R/utils-get_code_dependency.R      184       1  99.46%   275
R/verify.R                          42      11  73.81%   65, 95-99, 102-106
TOTAL                              850      95  88.82%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  --------
TOTAL             0       0  +100.00%

Results for commit: a93992e161c839ec6cd0a67e10501e47ca536536

Minimum allowed coverage is 80%

:recycle: This comment has been updated with latest results

github-actions[bot] commented 5 months ago

Unit Tests Summary

  1 files   14 suites   2s :stopwatch: 193 tests 191 :white_check_mark: 2 :zzz: 0 :x: 265 runs  263 :white_check_mark: 2 :zzz: 0 :x:

Results for commit a93992e1.

github-actions[bot] commented 5 months ago

Unit Test Performance Difference

Additional test case details | Test Suite | $Status$ | Time on `main` | $±Time$ | Test Case | |:-----|:----:|:----:|:----:|:-----| | get_code | 👶 | | $+0.03$ | ignores_occurrence_in_a_function_definition_that_has_function_in_it |

Results for commit 3d72a6f5f148554cde3fed4cf5d47fbf482a9fc1

♻️ This comment has been updated with latest results.

m7pr commented 5 months ago

Yeah, just to let you know get_code without datanames runs teal.code::get_code. Only when you use datanames we use the part from teal.data