metrumresearchgroup / pkgr

R package installation and management - reimagined.
https://metrumresearchgroup.github.io/pkgr/docs
39 stars 4 forks source link

yml config protection from spacing errors #27

Open dpastoor opened 5 years ago

dpastoor commented 5 years ago
Customizations:
  Packages:
    - data.table:
        Env:
          - R_MAKEVARS_USER: "~/.R/Makevars_data.table"
  Repos:
    - r_validated:
        Type: source
0:11 (binary:source) packages available in for r_validated from https://metrumresearchgroup.github.io/r_validated
13338:13528 (binary:source) packages available in for CRAN from https://cran.rstudio.com
INFO[0000] package repository set                        pkg=PKPDmisc repo=CRAN type=binary version=2.1.1
INFO[0000] package repository set                        pkg=mrgsolve repo=r_validated type=source version=0.8.12
INFO[0000] package repository set                        pkg=rmarkdown repo=CRAN type=binary version=1.11
INFO[0000] package repository set                        pkg=bitops repo=CRAN type=binary version=1.0-6
INFO[0000] package repository set                        pkg=caTools repo=CRAN type=binary version=1.17.1.1
INFO[0000] package repository set                        pkg=GGally repo=CRAN type=binary version=1.4.0
INFO[0000] package repository set                        pkg=knitr repo=CRAN type=binary version=1.20
INFO[0000] package repository set                        pkg=gridExtra repo=CRAN type=binary version=2.3
INFO[0000] package repository set                        pkg=htmltools repo=CRAN type=binary version=0.3.6
INFO[0000] package repository set                        pkg=xtable repo=CRAN type=binary version=1.8-3
INFO[0000] package repository set                        pkg=dplyr repo=CRAN type=binary version=0.7.8
INFO[0000] package repository set                        pkg=ggplot2 repo=CRAN type=binary version=3.1.0
INFO[0000] package repository set                        pkg=shiny repo=CRAN type=binary version=1.2.0
INFO[0000] package repository set                        pkg=shinydashboard repo=CRAN type=binary version=0.7.1
INFO[0000] package repository set                        pkg=data.table repo=CRAN type=binary version=1.11.8

notably, this spacing difference:

   Repos:
     - r_validated:
-        Type: source
   Repos:
     - r_validated:
+      Type: source  

causes the r_validated type source to not be properly assigned, hence, defaults to the binary version (which doesn't exist in r_validated, and falls back to cran, as shown when comparing

-pkg=mrgsolve repo=r_validated type=source version=0.8.12
+pkg=mrgsolve repo=CRAN type=binary version=0.8.12

Might want to look at if there are some yaml structure verifiers or something to detect parseable, but mis-structured configuration.

dpastoor commented 5 years ago

Best option seems to be to make sure to always use 4 explicit spaces, not tabs, when typing the yaml.