-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into allow-fn-brace
- Loading branch information
Showing
119 changed files
with
1,110 additions
and
728 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
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,71 @@ | ||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Trigger once a month at 10:00 on the first day of every month | ||
- cron: "00 10 1 * *" | ||
|
||
name: test-coverage-examples | ||
|
||
jobs: | ||
test-coverage-examples: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: | | ||
any::covr | ||
local::. | ||
- name: Test example coverage | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
library(covr) | ||
files_to_exclude <- c( | ||
# examples present but not run | ||
"R/lint.R", | ||
"R/use_lintr.R", | ||
# mostly internal utilities | ||
"R/actions.R", | ||
"R/cache.R", | ||
"R/deprecated.R", | ||
"R/exclude.R", | ||
"R/extract.R", | ||
"R/ids_with_token.R", | ||
"R/lintr-deprecated.R", | ||
"R/make_linter_from_regex.R", | ||
"R/make_linter_from_xpath.R", | ||
"R/namespace.R", | ||
"R/methods.R", | ||
"R/settings.R", | ||
"R/shared_constants.R", | ||
"R/with.R", | ||
"R/with_id.R", | ||
"R/zzz.R" | ||
) | ||
coverage <- covr::package_coverage( | ||
type = "examples", | ||
quiet = TRUE, | ||
commentDonttest = FALSE, | ||
commentDontrun = FALSE, | ||
line_exclusions = files_to_exclude | ||
) | ||
print(coverage) | ||
percent_coverage <- as.integer(covr::percent_coverage(coverage)) | ||
threshold <- 90 | ||
cli::cli_rule() | ||
if (percent_coverage < threshold) { | ||
cli::cli_abort("Code coverage using examples ({percent_coverage}%) is below the required threshold ({threshold}%).") | ||
} else { | ||
cli::cli_alert_success("Code coverage using examples ({percent_coverage}%) is above the required threshold ({threshold}%).") | ||
} | ||
cli::cli_rule() | ||
shell: Rscript {0} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
YEAR: 2014-2016 | ||
YEAR: 2014-2024 | ||
COPYRIGHT HOLDER: James Hester |
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
Oops, something went wrong.