Giter VIP home page Giter VIP logo

intergrate's People

Contributors

csgillespie avatar russhyde avatar sebble avatar sjimellor-jr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

intergrate's Issues

Check version number

If the package has changed, then we should bump the version number

Version numbers don't need to be bumped for ignored files though

check_version checks against previous commit ot master, rather than checking against tag on repo.

If the definition of a 'version' is a tag on the repo, then the definition of whether a given commit is a different 'version' is whether the version number of that commit is different from the version number of the previous tag, if it exists. If no tags exist, then it should be judged that there is no previous version with which to compare the version and the check should accept the version number.

https://github.com/jumpingrivers/inteRgrate/blob/master/R/check_version.R

"Issues detected" remains after issue is resolved

Issue description

When inteRgrate::check_all() detects an issue which is later resolved, the "Issues Detected" message will continue to be displayed on subsequent calls to check_all.

Steps to reproduce the issue

  1. Start a new, empty R session.
  2. Find an R package that currently passes inteRgrate::check_all()
  3. Make a change that will cause the check_all tests to fail. For the example results below, I changed the NEWS.md file to have an incorrect format.
  4. Run inteRgrate::check_all()
  5. Revert the changes made to the code to get back to the package which previously passes inteRgrate::check_all()
  6. Run inteRgrate::check_all(). Check through the results to confirm no errors other than the "Issues Detected" warning at the end.
  7. Restart the R session (don't save anything in workspace)
  8. Run inteRgrate::check_all()

What's the expected result?

  • The "Issues Detected" message should not appear once the offending issue is resolved.

What's the actual result?

  • The "Issues Detected" message continues to be displayed after the issue is fixed, until the session is restarted.

Additional details

An output that changes is under the "Creating a tag...create_tag()" section where the output from the passing version is

ℹ No tagging: doesn't seem to be a CI process

but after failing and reverting to the original method, this is stuck on

ℹ No tagging: fix checking errors

Despite no checking errors being shown.

Output from a working and passing package check:

Restarting R session...

> inteRgrate::check_all()

── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

── Installing package ──

✔  checking for file ‘/tmp/RtmpMJTIaD/file8e3e5178dc1a/<package_name>/DESCRIPTION’
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (776ms)
   
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘.../DESCRIPTION’ ...
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (803ms)
   
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/tmp/RtmpMJTIaD/file8e3e2b1b5db6/<package_name>.Rcheck’
─  using R version 4.2.0 (2022-04-22)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  using session charset: UTF-8
✔  checking for file ‘<package_name>/DESCRIPTION’ ...
─  checking extension type ... Package
─  this is package ‘<package_name>’ version ‘1.1.6’
─  package encoding: UTF-8
✔  checking package namespace information ...
✔  checking package dependencies (1.4s)
✔  checking if this is a source package ...
✔  checking if there is a namespace
✔  checking for executable files ...
✔  checking for hidden files and directories ...
✔  checking for portable file names
✔  checking for sufficient/correct file permissions
✔  checking whether package ‘<package_name>’ can be installed (808ms)
✔  checking installed package size ...
✔  checking package directory
✔  checking DESCRIPTION meta-information ...
✔  checking top-level files ...
✔  checking for left-over files
✔  checking index information
✔  checking package subdirectories ...
✔  checking R files for non-ASCII characters ...
✔  checking R files for syntax errors ...
✔  checking whether the package can be loaded ...
✔  checking whether the package can be loaded with stated dependencies ...
✔  checking whether the package can be unloaded cleanly ...
✔  checking whether the namespace can be loaded with stated dependencies ...
✔  checking whether the namespace can be unloaded cleanly ...
✔  checking loading without being on the library search path ...
✔  checking dependencies in R code ...
✔  checking S3 generic/method consistency (437ms)
✔  checking replacement functions ...
✔  checking foreign function calls ...
✔  checking R code for possible problems (571ms)
✔  checking Rd files ...
✔  checking Rd metadata ...
✔  checking Rd cross-references ...
✔  checking for missing documentation entries ...
✔  checking for code/documentation mismatches (461ms)
✔  checking Rd \usage sections (452ms)
✔  checking Rd contents ...
✔  checking for unstated dependencies in examples ...
✔  checking contents of ‘data’ directory (910ms)
✔  checking data for non-ASCII characters (949ms)
✔  checking data for ASCII and uncompressed saves ...
✔  checking examples (1.2s)
✔  checking PDF version of manual (579ms)
   
   
── Checking lint...check_lintr() 
....
✔ Lint looks good

── Checking namespace for imports()...check_namespace() 
✔ Imports look good - 0 found, 0 allowed

── Checking file extensions...check_r_filenames() 
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good

── Checking version...check_version() 
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
 * branch            main       -> FETCH_HEAD
   94b4bf7..417ff43  main       -> origin/main
✔ Your version is fine!

── Checking .gitignore...check_gitignore() 
✔ .gitignore looks good

── Checking tidy descriptions...check_tidy_descriptions() 
✔ Setting active project to '/home/keith/[redacted]/[redacted]-intro/r_pkgs/<package_name>'
✔ Your description is tidy!

── Checking file permissions...check_file_permissions() 
✔ File modes looks good

── Checking line breaks...check_line_breaks() 
✔ Line breaks look good

── Creating a tag...create_tag() 
ℹ No tagging: doesn't seem to be a CI process

── Checking NEWS.md...check_news() 
✔ Your NEWS.md has the correct format

── Checking Rproj...check_rproj() 
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!

After modifying the NEWS file to have an incorrect header:

> inteRgrate::check_all()

── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

── Installing package ──

✔  checking for file ‘/tmp/RtmpMJTIaD/file8e3e5f8a2d15/<package_name>/DESCRIPTION’ ...
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (830ms)
   
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘.../DESCRIPTION’ ...
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (826ms)
   
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/tmp/RtmpMJTIaD/file8e3e57f67323/<package_name>.Rcheck’
─  using R version 4.2.0 (2022-04-22)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  using session charset: UTF-8
✔  checking for file ‘<package_name>/DESCRIPTION’ ...
─  checking extension type ... Package
─  this is package ‘<package_name>’ version ‘1.1.6’
─  package encoding: UTF-8
✔  checking package namespace information ...
✔  checking package dependencies (3.2s)
✔  checking if this is a source package ...
✔  checking if there is a namespace
✔  checking for executable files ...
✔  checking for hidden files and directories ...
✔  checking for portable file names
✔  checking for sufficient/correct file permissions
✔  checking whether package ‘<package_name>’ can be installed (775ms)
✔  checking installed package size ...
✔  checking package directory
✔  checking DESCRIPTION meta-information ...
✔  checking top-level files ...
✔  checking for left-over files
✔  checking index information
✔  checking package subdirectories ...
✔  checking R files for non-ASCII characters ...
✔  checking R files for syntax errors ...
✔  checking whether the package can be loaded ...
✔  checking whether the package can be loaded with stated dependencies ...
✔  checking whether the package can be unloaded cleanly ...
✔  checking whether the namespace can be loaded with stated dependencies ...
✔  checking whether the namespace can be unloaded cleanly ...
✔  checking loading without being on the library search path ...
✔  checking dependencies in R code ...
✔  checking S3 generic/method consistency (393ms)
✔  checking replacement functions ...
✔  checking foreign function calls ...
✔  checking R code for possible problems (562ms)
✔  checking Rd files ...
✔  checking Rd metadata ...
✔  checking Rd cross-references ...
✔  checking for missing documentation entries ...
✔  checking for code/documentation mismatches (457ms)
✔  checking Rd \usage sections (454ms)
✔  checking Rd contents ...
✔  checking for unstated dependencies in examples ...
✔  checking contents of ‘data’ directory (887ms)
✔  checking data for non-ASCII characters (927ms)
✔  checking data for ASCII and uncompressed saves ...
✔  checking examples (1.2s)
✔  checking PDF version of manual (574ms)
   
   
── Checking lint...check_lintr() 
....
✔ Lint looks good

── Checking namespace for imports()...check_namespace() 
✔ Imports look good - 0 found, 0 allowed

── Checking file extensions...check_r_filenames() 
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good

── Checking version...check_version() 
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
 * branch            main       -> FETCH_HEAD
✖ Please update the package version

── Checking .gitignore...check_gitignore() 
✔ .gitignore looks good

── Checking tidy descriptions...check_tidy_descriptions() 
✔ Your description is tidy!

── Checking file permissions...check_file_permissions() 
✔ File modes looks good

── Checking line breaks...check_line_breaks() 
✔ Line breaks look good

── Creating a tag...create_tag() 
ℹ No tagging: fix checking errors

── Checking NEWS.md...check_news() 
✖ Top line of NEWS.md not have correct format. It should be
# <package_name> 1.1.6 _2022-06-27_

── Checking Rproj...check_rproj() 
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!
✖ Issues Detected
Error in inteRgrate::check_all() : Please fix

After reverting the code back to working order, but in the same R session as the last check:

> inteRgrate::check_all()

── inteRgrate version 1.0.22 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

── Installing package ──

✔  checking for file ‘/tmp/RtmpMJTIaD/file8e3e40410a30/<package_name>/DESCRIPTION’ ...
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (790ms)
   
Installing package into ‘/home/keith/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
* installing *source* package ‘<package_name>’ ...
** using staged installation
** R
** data
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (<package_name>)
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘.../DESCRIPTION’ ...
─  preparing ‘<package_name>’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘<package_name>_1.1.6.tar.gz’ (787ms)
   
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory ‘/tmp/RtmpMJTIaD/file8e3e16ead3f0/<package_name>.Rcheck’
─  using R version 4.2.0 (2022-04-22)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  using session charset: UTF-8
✔  checking for file ‘<package_name>/DESCRIPTION’ ...
─  checking extension type ... Package
─  this is package ‘<package_name>’ version ‘1.1.6’
─  package encoding: UTF-8
✔  checking package namespace information ...
✔  checking package dependencies (1.4s)
✔  checking if this is a source package ...
✔  checking if there is a namespace
✔  checking for executable files ...
✔  checking for hidden files and directories ...
✔  checking for portable file names
✔  checking for sufficient/correct file permissions
✔  checking whether package ‘<package_name>’ can be installed (776ms)
✔  checking installed package size ...
✔  checking package directory
✔  checking DESCRIPTION meta-information ...
✔  checking top-level files
✔  checking for left-over files
✔  checking index information
✔  checking package subdirectories ...
✔  checking R files for non-ASCII characters ...
✔  checking R files for syntax errors ...
✔  checking whether the package can be loaded ...
✔  checking whether the package can be loaded with stated dependencies ...
✔  checking whether the package can be unloaded cleanly ...
✔  checking whether the namespace can be loaded with stated dependencies ...
✔  checking whether the namespace can be unloaded cleanly ...
✔  checking loading without being on the library search path ...
✔  checking dependencies in R code ...
✔  checking S3 generic/method consistency (398ms)
✔  checking replacement functions ...
✔  checking foreign function calls ...
✔  checking R code for possible problems (553ms)
✔  checking Rd files ...
✔  checking Rd metadata ...
✔  checking Rd cross-references ...
✔  checking for missing documentation entries ...
✔  checking for code/documentation mismatches (447ms)
✔  checking Rd \usage sections (450ms)
✔  checking Rd contents ...
✔  checking for unstated dependencies in examples ...
✔  checking contents of ‘data’ directory (872ms)
✔  checking data for non-ASCII characters (927ms)
✔  checking data for ASCII and uncompressed saves ...
✔  checking examples (1.2s)
✔  checking PDF version of manual (553ms)
   
   
── Checking lint...check_lintr() 
....
✔ Lint looks good

── Checking namespace for imports()...check_namespace() 
✔ Imports look good - 0 found, 0 allowed

── Checking file extensions...check_r_filenames() 
ℹ 3 R files found
✔ Extensions look good
✔ Filenames look good

── Checking version...check_version() 
From gitlab.com:[redacted]/[redacted]/r/[redacted]-to-[redacted]
 * branch            main       -> FETCH_HEAD
✔ Your version is fine!

── Checking .gitignore...check_gitignore() 
✔ .gitignore looks good

── Checking tidy descriptions...check_tidy_descriptions() 
✔ Your description is tidy!

── Checking file permissions...check_file_permissions() 
✔ File modes looks good

── Checking line breaks...check_line_breaks() 
✔ Line breaks look good

── Creating a tag...create_tag() 
ℹ No tagging: fix checking errors

── Checking NEWS.md...check_news() 
✔ Your NEWS.md has the correct format

── Checking Rproj...check_rproj() 
ℹ Reading <package_name>.Rproj
✔ Rproj looks good!
✖ Issues Detected
Error in inteRgrate::check_all() : Please fix

check_lintr() pulls up R/sysdata.rda for no newline

Adding internal package data with usethis::use_data(..., internal = TRUE) creates R/sysdata.rda.

inteRgrate::check_lintr() runs inteRgrate:::readLines() on all files in R/ (check_lintr.R lines 57--58) and throws a warning for no newline at end of file for sysdata.rda file. I could be wrong but I don't think this can/should be fixed directly.

Adding to .lintr exclusions doesn't work in this instance since the code is applied to all files in the R directory regardless.

Suggest perhaps modify line 57 to include .lintr exclusions/include only *.R files?

check_news.R description misleading

The description of the check_news.R function states:

the expected format is either: (...) or \code{# pkg_name _(development version)_}

However, the function actually checks the pattern # pkg_name (development version). (No underscores)

Check that Windows hasn't changed things

The check should:

  • Have any file modes changed at all (presumably because I messed up)?
  • Do any new files have silly permissions?

And I wouldn't be offended if this only runs when the committer is Windows, because potentially scanning all files is a waste for most people.


Current githook:

  • dos2unix on everything to remove Windows line endings
  • chmod -R o-w to remove public write on everything
  • find . -name '*.txt|md|Rmd|yml|json'|chmod -x to stop text files being executable

Change to "check"

Environment variables

Create standard environment variables under travis/gitlab

  • package tar ball location

Add optional pkgdown deployment job

Configure with e.g., DEPLOY_PKGDOWN=true
Run after tagging?

Option 1:

Build pkgdown in CI task
Use Connect app API to create or identify existing app
Update Connect custom URL with API
Use Connect bundle deployment API to push new tar file (https://rstudio.github.io/connectapi/#deployment)

Option 2:

Provide Makefile and manifest.json to be stored in e.g., ~/docs directory of original source of package?
Use Connect app API to create or identify existing app
Update Connect custom URL with API
Trigger git deploy or rebuild on Connect using API

Option 3:

Create/update a dedicated branch for pkdown documentation, like gh-pages
[optional] trigger initial Connect deployment or forced update

Questions

  • Is this suitable for inteRgrate or is it too specific to JR?
  • Where to configure Connect API URL and API token?
  • Does https://github.com/ropenscilabs/tic.package help? (uses dedicated branch)

Check .gitignore for standard R files

See https://github.com/r-lib/usethis/search?q=git_global_ignore&unscoped_q=git_global_ignore

and

# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
rsconnect/

Add check_all alias?

Does an equivalent exist?

check_all = function() {
  check_via_env(pkg = TRUE, lintr = TRUE, namespace = TRUE, r_filenames = TRUE, 
    version = TRUE, gitignore = TRUE, tidy_description = TRUE, 
    readme = TRUE, file_permissions = TRUE, line_breaks = TRUE, tag = FALSE)
}

Error with sample code

I cannot run the code which you provide:

image: rocker/r-ubuntu:18.04
variables:
  ALLOWED_WARNINGS: 0
  ALLOWED_NOTES: 0
  NO_IMPORTS: 0

before_script:
  - Rscript -e "install.packages('remotes')"
  - Rscript -e "remotes::install_github('jumpingrivers/inteRgrate')"

check:
  script:
    - Rscript -e "inteRgrate::check_via_env(default = 'true')"

It leaves me following error message:

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘lintr’, ‘rcmdcheck’, ‘usethis’ are not available for package ‘inteRgrate’
* removing ‘/usr/local/lib/R/site-library/inteRgrate’
There were 11 warnings (use warnings() to see them)
$ Rscript -e "inteRgrate::check_lintr(path = '.')"
Error in loadNamespace(x) : there is no package called ‘inteRgrate’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.