Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Jun 6, 2024
1 parent de68b5f commit 2fa7575
Show file tree
Hide file tree
Showing 231 changed files with 109,893 additions and 5 deletions.
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ Suggests:
VignetteBuilder: knitr
URL: https://noclocks.github.io/noclocksR/
Config/testthat/edition: 3
Depends:
R (>= 2.10)
LazyData: true
23 changes: 18 additions & 5 deletions dev/pkgdevt.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@

# libraries ---------------------------------------------------------------

library(devtools)
library(usethis)
library(roxygen2)


require(devtools)
require(usethis)
require(roxygen2)
require(testthat)
require(fusen)
require(lozen)
require(attachment)
require(gitdown)
require(testdown)

# pak::pak(c("covr", "codemetar", "pkgdown", "pagedown", "bookdown", "rmarkdown"))
# pak::pak("ThinkR-open/lozen")
# pak::pak("ThinkR-open/fusen")
# pak::pak("ThinkR-open/gitdown")
# pak::pak("ThinkR-open/testdown")

usethis::use_data_raw("gitignore_templates")
usethis::use_data_raw("client_demo_data")

# initialize --------------------------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions inst/auth0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: myApp
remote_url: ''
auth0_config:
api_url: !expr paste0('https://', Sys.getenv('AUTH0_USER'), '.auth0.com')
credentials:
key: !expr Sys.getenv("AUTH0_KEY")
secret: !expr Sys.getenv("AUTH0_SECRET")
15 changes: 15 additions & 0 deletions inst/templates/markdown/coverage_report_explanation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Description of Coverage Report

- Total coverage percentage, this is the total number of lines covered by a test divided by the total number of lines requiring testing.
- File = Name of the file, the code coverage is calculated per file.
- Lines = Number of lines in the file, corresponds to the number of lines inside the file.
- Relevant = Corresponds to the lines of code to be tested (i.e. the lines inside the function brackets with the brackets and comments removed).
- Covered = Number of lines covered by a test
- Missed = Number of lines not covered by a test
- Hits/Line = Corresponds to the average number of times specific lines are tested in the file.
+ In other words, if I have an 11-lines file where (1) the first 6 lines are tested 4 times, (2) the seventh is tested 1 time, (3) the last 4 are tested 10 times. The calculation is then: ((6 * 4) + 1 + (10 * 4))/11 = 6. This gives the average number of times a line is tested, here 6.
- Coverage = corresponds to the percentage of lines covered by a test. Calculation: Covered / Relevant * 100, number of lines covered by a test divided by the number of lines requiring testing.
- If we go into detail by file, the color code is as follows:
- green line = line tested by at least one test (the x? corresponds to the number of times the line is tested)
- red line = line not covered by a test
- white line = lines not to be tested (comments, ...)
107 changes: 107 additions & 0 deletions pkgdown/assets/coverage/codecoverage_explanation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Description of Coverage Report</title>
<style type="text/css">
body {
font-family: sans-serif;
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 1.5;
box-sizing: border-box;
}
body, .footnotes, code { font-size: .9em; }
li li { font-size: .95em; }
*, *:before, *:after {
box-sizing: inherit;
}
pre, img { max-width: 100%; }
pre, pre:hover {
white-space: pre-wrap;
word-break: break-all;
}
pre code {
display: block;
overflow-x: auto;
}
code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
:not(pre) > code, code[class] { background-color: #F8F8F8; }
code.language-undefined, pre > code:not([class]) {
background-color: inherit;
border: 1px solid #eee;
}
table {
margin: auto;
border-top: 1px solid #666;
}
table thead th { border-bottom: 1px solid #ddd; }
th, td { padding: 5px; }
thead, tfoot, tr:nth-child(even) { background: #eee; }
blockquote {
color: #666;
margin: 0;
padding-left: 1em;
border-left: 0.5em solid #eee;
}
hr, .footnotes::before { border: 1px dashed #ddd; }
.frontmatter { text-align: center; }
#TOC .numbered li { list-style: none; }
#TOC .numbered { padding-left: 0; }
#TOC .numbered ul { padding-left: 1em; }
table, .body h2 { border-bottom: 1px solid #666; }
.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
.footnote-ref a::before { content: "["; }
.footnote-ref a::after { content: "]"; }
section.footnotes::before {
content: "";
display: block;
max-width: 20em;
}

@media print {
body {
font-size: 12pt;
max-width: 100%;
}
tr, img { page-break-inside: avoid; }
}
@media only screen and (min-width: 992px) {
pre { white-space: pre; }
}
</style>
</head>
<body>
<div class="frontmatter">
<div class="title"><h1>Description of Coverage Report</h1></div>
<div class="author"><h2></h2></div>
<div class="date"><h3></h3></div>
</div>
<div class="body">
<h2 id="description-of-coverage-report">Description of Coverage Report</h2>
<ul>
<li>Total coverage percentage, this is the total number of lines covered by a test divided by the total number of lines requiring testing.</li>
<li>File = Name of the file, the code coverage is calculated per file.</li>
<li>Lines = Number of lines in the file, corresponds to the number of lines inside the file.</li>
<li>Relevant = Corresponds to the lines of code to be tested (i.e. the lines inside the function brackets with the brackets and comments removed).</li>
<li>Covered = Number of lines covered by a test</li>
<li>Missed = Number of lines not covered by a test</li>
<li>Hits/Line = Corresponds to the average number of times specific lines are tested in the file.
<ul>
<li>In other words, if I have an 11-lines file where (1) the first 6 lines are tested 4 times, (2) the seventh is tested 1 time, (3) the last 4 are tested 10 times. The calculation is then: ((6 * 4) + 1 + (10 * 4))/11 = 6. This gives the average number of times a line is tested, here 6.</li>
</ul>
</li>
<li>Coverage = corresponds to the percentage of lines covered by a test. Calculation: Covered / Relevant * 100, number of lines covered by a test divided by the number of lines requiring testing.</li>
<li>If we go into detail by file, the color code is as follows:
<ul>
<li>green line = line tested by at least one test (the x? corresponds to the number of times the line is tested)</li>
<li>red line = line not covered by a test</li>
<li>white line = lines not to be tested (comments, …)</li>
</ul>
</li>
</ul>
</div>
</body>
</html>
Loading

0 comments on commit 2fa7575

Please sign in to comment.