-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
169 wrapping up the long code in the Report (#218)
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](#169 (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: - It exposes Knitr options to users through the functions 'download_report_button_srv', 'reporter_previewer_srv,' 'simple_reporter_srv,' and the R6 renderer. - The Roxygen documentation has been updated to reflect these modifications. changes in reports are observed as follows. branch: main <img width="613" alt="image" src="https://github.com/insightsengineering/teal.reporter/assets/6700955/84998f72-1676-46bc-aff1-e376b68e2c22"> branch: 169_wrap_rcode@main <img width="582" alt="image" src="https://github.com/insightsengineering/teal.reporter/assets/6700955/be027ece-c2b8-45c0-85cc-719c7ee306f6"> --------- Signed-off-by: kartikeya kirar <[email protected]> Co-authored-by: kartikeya <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Marcin <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b82c2ac
commit 6a30a56
Showing
15 changed files
with
155 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
linters: linters_with_defaults( | ||
line_length_linter = line_length_linter(120), | ||
cyclocomp_linter = NULL, | ||
object_usage_linter = NULL | ||
object_usage_linter = NULL, | ||
indentation_linter = NULL | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.onLoad <- function(libname, pkgname) { | ||
op <- options() | ||
default_global_knitr <- list(teal.reporter.global_knitr = list( | ||
echo = TRUE, | ||
tidy.opts = list(width.cutoff = 60), | ||
tidy = requireNamespace("formatR", quietly = TRUE) | ||
)) | ||
|
||
if (!("teal.reporter.global_knitr" %in% names(op))) { | ||
options(default_global_knitr) | ||
} | ||
|
||
invisible() | ||
} | ||
|
||
.onAttach <- function(libname, pkgname) { | ||
packageStartupMessage( | ||
if (!requireNamespace("formatR", quietly = TRUE)) { | ||
"For better code formatting, consider installing the formatR package." | ||
} | ||
) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.