-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
169 wrapping up the long code in the Report #218
Conversation
Code Coverage Summary
Diff against main
Results for commit: 71b6d8a Minimum allowed coverage is ♻️ This comment has been updated with latest results |
@pawelru what are your thoughts on this? I know we had some conversation about packages being in Suggests and being checked on a code execution, but this is totally minor and I would accept this the way it is. |
Merge branch 'main' into 169_wrap_rcode@main # Conflicts: # R/Renderer.R
I have set the default options for global_knitr |
I found a better option. If we set tidy = 'formatR', then tidy.opts is not required to remove blank lines and cut the code lines at 60 characters. (making following changes) |
@kartikeyakirar what if we create options(teal.reporter.knit.global = list(echo = TRUE, tidy.opts = list(width.cutoff = 60), tidy = FALSE)) on a package startup, and then we reuse |
@kartikeyakirar please see my changes to one place where you provided those @details. |
DESCRIPTION
Outdated
@@ -31,6 +31,7 @@ Imports: | |||
zip (>= 1.1.0) | |||
Suggests: | |||
DT (>= 0.13), | |||
formatR, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @kartikeyakirar can you run verdepcheck flow to determine the minimal needed version of this package?
Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com>
Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com>
Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: kartikeya kirar <kirar.kartikeya1@gmail.com>
Merge branch '169_wrap_rcode@main' of https://github.com/insightsengineering/teal.reporter into 169_wrap_rcode@main # Conflicts: # man/download_report_button_srv.Rd
@template is superseded instead I have defined the details in |
@kartikeyakirar I wanted you to create roxygen template, not to inherit details. Please subsitute Then create a file
#' @details To access the default values for the `global_knitr` parameter, use `getOption("teal.reporter.global_knitr")`. These defaults include:
#' - `echo = TRUE`
#' - `tidy.opts = list(width.cutoff = 60)`
#' - `tidy = TRUE` if `formatR` package is installed, `FALSE` otherwise |
@kartikeyakirar alrighty, they suggest
Can you follow https://rmarkdown.rstudio.com/lesson-4.html ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kartikeyakirar looks good now. That was a long ride.
Would you be able to create a comment that proves that it works? The comparison of a behavior on main
with this branch for the usage of all methods/functions that were changed?
thanks for review @m7pr , I have updated description for this. |
coolio 👍 |
this Fixes #169
I've implemented a solution that relies on the formatR package. I've ensured that this solution checks for the package in the namespace; if it's not accessible, the user will be notified. To maintain flexibility, I've included the formatR package in the suggested dependencies, as there are no strict dependencies on it.
In response to the feedback provided by @m7pr in this comment, I've updated the default value of global_knitr to list(echo = TRUE, tidy.opts = list(width.cutoff = 60), tidy = FALSE).
Please note that there was an alternative option to set tidy = "styler", but I opted against it due to the additional dependency it would introduce (the styler package). Feel free to review the changes and let me know if any further adjustments are needed.
This branch utilizes the functionality provided by the 'formatR' package to automatically add spaces and indentations to the code. However, it does create a strong dependency on the 'formatR' package. If the package is not installed, the output will be generated without any formatting.
Additionally, this branch introduces the following changes:
changes in reports are observed as follows.
branch: main
![image](https://private-user-images.githubusercontent.com/6700955/272569278-84998f72-1676-46bc-aff1-e376b68e2c22.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MzA0MTUsIm5iZiI6MTczOTQzMDExNSwicGF0aCI6Ii82NzAwOTU1LzI3MjU2OTI3OC04NDk5OGY3Mi0xNjc2LTQ2YmMtYWZmMS1lMzc2YjY4ZTJjMjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMDcwMTU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ODMxNmU5MTU2NWViNzc5MjcwYTZlZGMzN2NmMjYzMzJjMWFlMGViZWYzMDA4MzU5NTJjMTY1MGNjMzhiNjFkYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.6PTJgMTwQpjXy3AO5PTC6_YDRaXHqE6MNOc04oqwKEM)
branch: 169_wrap_rcode@main
![image](https://private-user-images.githubusercontent.com/6700955/272569038-be027ece-c2b8-45c0-85cc-719c7ee306f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MzA0MTUsIm5iZiI6MTczOTQzMDExNSwicGF0aCI6Ii82NzAwOTU1LzI3MjU2OTAzOC1iZTAyN2VjZS1jMmI4LTQ1YzAtODVjYy03MTljN2VlMzA2ZjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMDcwMTU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGU1NzJhNGU4NTUyN2MyM2E0ODFiYzVmNDM5N2ZkNDUzNTVhODJjOTEyZDA2NWI1YzI1YjY5NTkzMzY0OTFhMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ingAIEucxXB49l4EG2aMhSQX8FeNvj-a0wmJbS3mcss)