You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linter github action ran as expected but shows too many warnings (3780):
dir
n warning
R
2246
inst
1012
tests
325
vignettes
197
To be useful, the linter would need to be configured:
ignore the inst directory,
Configure object_name_linter to accept symbols, CamelCase and camelCase,
ignore line length linter,
ignore the shinyApp code
With the folowing .lintr file (initiated by lintr::use_lintr())
linters: linters_with_defaults(
object_name_linter(styles = c("CamelCase", "camelCase", "symbols", "dotted.case")), # according to naming rules
line_length_linter = NULL, # not a big deal
commented_code_linter = NULL, # maybe we should decide on that ?
object_length_linter = NULL, # maybe we could fix that
cyclocomp_linter = NULL # what is the impact of too high cyclocomp ?
)
exclusions: list(
"inst", # not really code
"tests/testthat/test-predefined-functions.R", # weird function names
"R/aggregation-input.R" # weird functions tests
)
encoding: "UTF-8"
With this configuration, we get the following result:
Warning: file=R/atom-plots.R,line=651,col=3,[object_usage_linter] local variable ‘legendLength’ assigned but may not be used
Warning: file=R/plot-histogram.R,line=121,col=20,[object_usage_linter] no visible binding for global variable ‘count’
Warning: file=R/plot-histogram.R,line=131,col=22,[object_usage_linter] no visible binding for global variable ‘ncount’
Warning: file=R/plot-histogram.R,line=131,col=35,[object_usage_linter] no visible binding for global variable ‘width’
Warning: file=R/plot-histogram.R,line=140,col=24,[object_usage_linter] no visible binding for global variable ‘count’
Warning: file=R/plot-histogram.R,line=140,col=24,[object_usage_linter] no visible binding for global variable ‘count’
Warning: file=R/plot-timeprofile.R,line=240,col=3,[object_usage_linter] local variable ‘simColorValues’ assigned but may not be used
Warning: file=R/plot-timeprofile.R,line=269,col=3,[object_usage_linter] local variable ‘obsColorValues’ assigned but may not be used
Warning: file=R/plot-timeprofile.R,line=336,col=56,[vector_logic_linter] Conditional expressions require scalar logical operators (&& and ||)
Warning: file=R/utilities-axis.R,line=[19](https://github.com/Felixmil/TLF-Library/actions/runs/4544729742/jobs/8011142798#step:5:20)6,col=24,[seq_linter] 1:length(...) is likely to be wrong in the empty edge case. Use seq_along(...) instead.
Warning: file=R/utilities-export.R,line=281,col=65,[vector_logic_linter] Conditional expressions require scalar logical operators (&& and ||)
Warning: file=R/utilities-mapping.R,line=234,col=23,[vector_logic_linter] Conditional expressions require scalar logical operators (&& and ||)
Warning: file=tests/testthat/test-plot-grid.R,line=6,col=1,[object_name_linter] Variable and function name style should be CamelCase, camelCase, symbols or dotted.case.
Warning: file=vignettes/tlf.Rmd,line=125,col=[23](https://github.com/Felixmil/TLF-Library/actions/runs/4544729742/jobs/8011142798#step:5:24),[seq_linter] 1:nrow(...) is likely to be wrong in the empty edge case. Use seq_len(nrow(...)) instead.
Each of these warning are fixable. Once fixed, future lintr run would provide good feedback on new code lines.
Code Coverage [✅ DONE]
Setup using
usethis::use_github_action("test-coverage")
Add codecov.io token in Github repo's secret variables.
in test-coverage.yaml replace covr::codecov() call by:
As requested in #424 (comment)
These tests were performed on my fork and a specific branch.
Setup Github Action
Setup using {usethis}
Problem:
{ospsuite.utils}
could not be installed.I had to add a
Remotes
field inDESCRIPTION
so the github action could install the dependency (it links back to #430).R CMD Check Action [✅ DONE]
The automated check was able to locate the intentional code error. It also raised few notes about ggplot2 pronouns but can be solved easily..
Removing the intentional error led to a successful build.
Linter [✅ DONE]
Setup using {usethis}
The linter github action ran as expected but shows too many warnings (3780):
To be useful, the linter would need to be configured:
inst
directory,object_name_linter
to accept symbols, CamelCase and camelCase,With the folowing
.lintr
file (initiated bylintr::use_lintr()
)With this configuration, we get the following result:
Each of these warning are fixable. Once fixed, future lintr run would provide good feedback on new code lines.
Code Coverage [✅ DONE]
Setup using
Add codecov.io token in Github repo's secret variables.
in
test-coverage.yaml
replacecovr::codecov()
call by:add tidyverse
codecov.yml
Style code [❌ TO DO]
Badges [❌ TO DO]
The text was updated successfully, but these errors were encountered: