diff --git a/CITATION.cff b/CITATION.cff index 7a19529e..bb678dca 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "cffr" in publications use:' type: software license: GPL-3.0-or-later title: 'cffr: Generate Citation File Format (''cff'') Metadata for R Packages' -version: 1.0.0.9000 +version: 1.0.1 doi: 10.21105/joss.03900 abstract: The Citation File Format version 1.2.0 is a human and machine readable file format which provides citation metadata for @@ -138,9 +138,6 @@ references: email: jeroen@berkeley.edu orcid: https://orcid.org/0000-0002-4035-0289 year: '2024' - identifiers: - - type: url - value: https://arxiv.org/abs/1403.2805 version: '>= 1.7.2' - type: software title: jsonvalidate diff --git a/DESCRIPTION b/DESCRIPTION index 7c015161..12fe7594 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: cffr Title: Generate Citation File Format ('cff') Metadata for R Packages -Version: 1.0.0.9000 +Version: 1.0.1 Authors@R: c( person("Diego", "Hernangómez", , "diego.hernangomezherrero@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658")), diff --git a/NEWS.md b/NEWS.md index 56fa263c..4cdb0665 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,8 @@ -# cffr (development version) +# cffr 1.0.1 - Update `cff_write()` to add a new `encoding` argument to make it work with different encodings, see `iconv()`. -- Fix NOTEs due to empty lines in docs. +- Fix **NOTEs** due to empty lines in docs. # cffr 1.0.0 diff --git a/README.Rmd b/README.Rmd index 69870225..dcc5e6d9 100644 --- a/README.Rmd +++ b/README.Rmd @@ -138,7 +138,7 @@ install.packages("cffr") You can install the developing version of **cffr** with: ```{r, eval=FALSE} -devtools::install_github("ropensci/cffr") +remotes::install_github("ropensci/cffr") ``` Alternatively, you can install **cffr** using the diff --git a/README.md b/README.md index 91318df5..4b9f7487 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,9 @@ file and the `CITATION` file (if present) of your package. Note that **cffr** works best if your package pass `R CMD check/devtools::check()`. -See [some projects already using -**cffr**](https://github.com/search?q=cffr%20path%3A**%2FCITATION.cff&type=code). +As per 2024-04-09 there are at least 351 repos on GitHub using **cffr**. +[Check them out +here](https://github.com/search?q=cffr%20path%3A**%2FCITATION.cff&type=code). ### Installation @@ -384,9 +385,6 @@ test <- cff_create("rmarkdown") email: jeroen@berkeley.edu orcid: https://orcid.org/0000-0002-4035-0289 year: '2024' - identifiers: - - type: url - value: https://arxiv.org/abs/1403.2805 - type: software title: knitr abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R' @@ -551,26 +549,6 @@ test <- cff_create("rmarkdown") - family-names: Chirico. given-names: Michael year: '2024' - - type: software - title: dygraphs - abstract: 'dygraphs: Interface to ''Dygraphs'' Interactive Time Series Charting - Library' - notes: Suggests - url: https://github.com/rstudio/dygraphs - repository: https://CRAN.R-project.org/package=dygraphs - authors: - - family-names: Vanderkam - given-names: Dan - website: http://dygraphs.com/ - - family-names: Allaire - given-names: JJ - - family-names: Owen - given-names: Jonathan - - family-names: Gromer - given-names: Daniel - - family-names: Thieurmel - given-names: Benoit - year: '2024' - type: software title: fs abstract: 'fs: Cross-Platform File System Operations Based on ''libuv''' @@ -587,26 +565,6 @@ test <- cff_create("rmarkdown") given-names: Gábor email: csardi.gabor@gmail.com year: '2024' - - type: software - title: rsconnect - abstract: 'rsconnect: Deploy Docs, Apps, and APIs to ''Posit Connect'', ''shinyapps.io'', - and ''RPubs''' - notes: Suggests - url: https://rstudio.github.io/rsconnect/ - repository: https://CRAN.R-project.org/package=rsconnect - authors: - - family-names: Atkins - given-names: Aron - email: aron@posit.co - - family-names: Allen - given-names: Toph - - family-names: Wickham - given-names: Hadley - - family-names: McPherson - given-names: Jonathan - - family-names: Allaire - given-names: JJ - year: '2024' - type: software title: downlit abstract: 'downlit: Syntax Highlighting and Automatic Linking' @@ -619,19 +577,6 @@ test <- cff_create("rmarkdown") email: hadley@posit.co year: '2024' version: '>= 0.4.0' - - type: software - title: katex - abstract: 'katex: Rendering Math to HTML, ''MathML'', or R-Documentation Format' - notes: Suggests - url: https://docs.ropensci.org/katex/ - repository: https://CRAN.R-project.org/package=katex - authors: - - family-names: Ooms - given-names: Jeroen - email: jeroen@berkeley.edu - orcid: https://orcid.org/0000-0002-4035-0289 - year: '2024' - version: '>= 1.4.0' - type: software title: sass abstract: 'sass: Syntactically Awesome Style Sheets (''Sass'')' @@ -742,18 +687,6 @@ test <- cff_create("rmarkdown") given-names: Davis email: davis@posit.co year: '2024' - - type: software - title: cleanrmd - abstract: 'cleanrmd: Clean Class-Less ''R Markdown'' HTML Documents' - notes: Suggests - url: https://pkg.garrickadenbuie.com/cleanrmd/ - repository: https://CRAN.R-project.org/package=cleanrmd - authors: - - family-names: Aden-Buie - given-names: Garrick - email: garrick@adenbuie.com - orcid: https://orcid.org/0000-0002-7111-0077 - year: '2024' - type: software title: withr abstract: 'withr: Run Code ''With'' Temporarily Modified Global State' @@ -888,8 +821,7 @@ for more info. ## References -
+
diff --git a/codemeta.json b/codemeta.json index 91b27e44..f186cbd3 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/ropensci/cffr", "issueTracker": "https://github.com/ropensci/cffr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "1.0.0.9000", + "version": "1.0.1", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -200,7 +200,7 @@ }, "isPartOf": "https://ropensci.org", "keywords": ["attribution", "citation", "credit", "citation-files", "cff", "metadata", "r", "r-package", "citation-file-format", "rstats", "ropensci", "cran"], - "fileSize": "1600.405KB", + "fileSize": "1598.15KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/data-raw/test-2as_bibentry.R b/data-raw/test-2as_bibentry.R deleted file mode 100644 index 4c26b099..00000000 --- a/data-raw/test-2as_bibentry.R +++ /dev/null @@ -1,510 +0,0 @@ -# Test Bibtex ---- -test_that("Article to bibtex", { - bib <- bibentry("Article", - key = "knuth:1984", - author = person("R Core Team"), - title = "Literate Programming", - journal = "The Computer Journal", - year = "1984", - # Optional - volume = "27", - number = 2, - pages = "97--111", - month = "January", - keywords = "Some, simple, keywords" - ) - expect_snapshot(toBibtex(bib)) - x <- as_cff(bib) - bib <- as_bibentry(x) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("Book to bibtex", { - bib <- bibentry("Book", - key = "latex:companion", - author = "Frank Mittelbach and Michel Gossens - and Johannes Braams and David Carlisle - and Chris Rowley", - editor = "{Barnes and Noble}", - title = "The LaTeX Companion", - publisher = "Addison-Wesley Professional", - year = "2004", - # Optional - volume = "3", - number = 7, - series = "The LateX Books", - address = "Santa Monica", - edition = "Fourth", - month = "August", - note = "Example modified for testing purposes", - keywords = c("Two, keyword") - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("Booklet to bibtex", { - bib <- bibentry("Booklet", - key = "Mustermann2016", - title = "Java Booklet", - # Optional - author = "Max Mustermann", - howpublished = "Internet", - address = "Stuttgart", - month = "feb", - year = "2016", - note = "Example modified from Jabref", - keywords = "java" - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("InBook to bibtex with pages", { - bib <- bibentry("InBook", - year = "2003", - month = "oct", - pages = "175--196", - title = "Architectural Mismatch Tolerance", - chapter = "Tolerances and Other Notes", - author = "R. de Lemos and C. Gacek and A. Romanovsky", - URL = "http://www.cs.kent.ac.uk/pubs/2003/1773", - publication_type = "inbook", - submission_id = "12884_1074884456", - ISBN = "3-540-40727-8", - editor = "A. Lalanda", - edition = "Fifth", - publisher = "Springer", - volume = "2677", - number = "234", - address = "Lozoya", - series = "Lecture Notes in Computer Science", - type = "Architecting Dependable Systems", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("InCollection to bibtex", { - bib <- bibentry("InCollection", - author = "Klaus Abels", - title = "Who Gives a Damn about Minimizers in Questions?", - booktitle = "Proceedings from Semantics and Linguistic Theory {XIII}", - publisher = "Cornell University", - year = 2003, - editor = "Robert B. Young and Yuping Zhou", - pages = "1--18", - address = "Ithaca, New York", - topic = "interrogatives;nl-semantics;polarity;" - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("InProceedings to bibtex", { - bib <- bibentry("InProceedings", - author = "John Aberdeen and Samuel Bayer and Sasha Caskey and Laurie - Damianos and Alan Goldschen and Lynette Hirschman and - Dan Loehr and Hugo Trapper", - title = "Implementing Practical Dialogue Systems with the - {DARPA} Communicator Architecture", - booktitle = "Proceedings of the {IJCAI}-99 Workshop on - Knowledge and Reasoning in Practical Dialogue Systems", - year = 1999, - editor = "Jan Alexandersson", - pages = "81--86", - series = "A Series", - organization = "IJCAI", - publisher = "International Joint Conference on Artificial Intelligence", - address = "Murray Hill, New Jersey", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) - - # If we remove collection title use conference - bibparsed[[1]]$`collection-title` <- NULL - bibparsed[[1]]$conference$name <- "I Am a conference" - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("Manual to bibtex", { - bib <- bibentry("Manual", - author = "Gerhard Allwein and Dave Barker-Plummer and Jon Barwise - and John Etchemendy", - title = "{LPL} Software Manual", - publisher = "{CSLI} Publications", - year = 1999, - address = "Stanford, California", - howpublished = "CD-Rom", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("MastersThesis to bibtex", { - bib <- bibentry("MastersThesis", - author = "Murat Bayraktar", - title = "Computer-Aided Analysis of {E}nglish Punctuation on a - Parsed Corpus: The Special Case of Comma", - school = "Department of Computer Engineering and Information - Science, Bilkent University, Turkey", - address = "Ankara, Turkey", - year = 1996, - note = "Forthcoming", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("PhdThesis to bibtex", { - bib <- bibentry("PhdThesis", - author = "David I. Beaver", - title = "Presupposition and Assertion in Dynamic Semantics", - school = "Centre for Cognitive Science, University of Edinburgh", - year = 1995, - type = "Ph.D. Dissertation", - address = "Edinburgh", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - - -test_that("Proceedings to bibtex", { - bib <- bibentry("Proceedings", - title = "An Abductive Framework for Negation in Disjunctive - Logic Programming", - organization = "{JELIA}'96", - year = 1996, - editor = "Jose Julio Alferes and Luis Moniz Pereira and Eva Orlowska", - publisher = "Springer-Verlag", - address = "Berlin", - missinginfo = "pages", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("TechReport to bibtex", { - bib <- bibentry("TechReport", - author = person("John M.", "Aronis", - comment = c(affiliation = "rOpenSci") - ), - title = "Implementing Inheritance on the Connection Machine", - institution = "Intelligent Systems Program, University of Pittsburgh", - number = "ISP 93-1", - year = 1993, - address = "Pittsburgh, PA 15260", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) - - # Fallback when missing institution - bibparsed[[1]]$institution <- NULL - - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("Unpublished to bibtex", { - bib <- bibentry("Unpublished", - author = "John M. Aronis and Foster J. Provost", - title = "Efficiently Constructing Relational Features from Background", - year = 1959, - note = paste0( - "Unpublished MS, Computer Science Department, ", - "University of Pittsburgh." - ), - missinginfo = "Date is guess.", - ) - - expect_snapshot(toBibtex(bib)) - bibparsed <- as_cff(bib) - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) - - # With custom note - bibparsed[[1]]$notes <- NULL - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("Test BibLateX entry", { - bib <- bibentry("Article", - author = "M. A. Kastenholz, and Philippe H. Hünenbergerb", - title = "Computation of methodology hyphen independent ionic solvation - free energies from molecular simulations", - journal = "J. Chem. Phys.", - year = 2006, - note = "Example modified for testing purposes", - pages = "55--65", - - # Additional BibLatex Fields - date = "2006-03-15", - file = "a_file.pdf", - issuetitle = "Semantic {3D} Media and Content", - translator = "Wicksteed, P. H. and {The translator factory}", - urldate = "2006-10-01", - pagetotal = 528, - abstract = "The computation of ionic solvation free energies from - atomistic simulations is a surprisingly difficult problem that - has found no satisfactory solution for more than 15 years.", - doi = "10.1063/1.2172593", - isbn = "0-816-52066-6", - issn = "0097-8493", - url = "http://www.ctan.org" - ) - expect_snapshot(toBibtex(bib)) - x <- as_cff(bib) - - - parsed <- as_bibentry(x) - expect_snapshot(toBibtex(parsed)) -}) - - -# Other testers ---- - -test_that("particle names", { - bib <- bibentry("Book", - title = "A Handbook for Scholars", - author = person("Mary-Claire", "van Leunen"), - year = 1979, - publisher = "Knopf" - ) - - - bibparsed <- as_cff(bib) - bibparsed[[1]]$authors <- as_cff_person( - "van Leunen, Mary-Claire and Davis, Jr., Sammy" - ) - - cffobj <- cff_create(cff(), - keys = list(references = bibparsed) - ) - - expect_true(cff_validate(cffobj, verbose = FALSE)) - - expect_snapshot(bibparsed) - - bib <- as_bibentry(bibparsed) - expect_snapshot(toBibtex(bib)) -}) - -test_that("From plain cff with a citation", { - s <- cff() - s <- cff_create(s) - - acit <- bibentry( - bibtype = "misc", title = "title", year = 1999, - author = "John Doe", - month = 3 - ) - - s$`preferred-citation` <- as_cff(acit)[[1]] - s$`preferred-citation`$editors <- as_cff_person("A name") - - bib <- as_bibentry(s) - expect_snapshot(toBibtex(bib)) -}) - -test_that("From plain cff", { - expect_silent(bib <- as_bibentry(cff())) - expect_snapshot(toBibtex(bib)) - - - expect_snapshot(as_bibentry(cff(), what = "anda"), error = TRUE) -}) - -test_that("From file", { - file <- system.file("examples/CITATION_complete.cff", - package = "cffr" - ) - - bib <- as_bibentry(file) - expect_snapshot(toBibtex(bib)) - - expect_snapshot(as_bibentry("anunkonwpackage"), error = TRUE) -}) - - -test_that("Test anonymous", { - bib <- bibentry("Booklet", - title = "A booklet" - ) - - - expect_silent(back <- as_bibentry(as_cff(bib))) - expect_snapshot(toBibtex(back)) - - - bib <- bibentry("manual", - title = "A manual" - ) - - - expect_silent(back <- as_bibentry(as_cff(bib))) - expect_snapshot(toBibtex(back)) - - bib <- bibentry("misc", - title = "A misc" - ) - - - expect_silent(back <- as_bibentry(as_cff(bib))) - expect_snapshot(toBibtex(back)) - - bib <- bibentry("proceedings", - title = "proceedings", - year = 1984 - ) - - - expect_silent(back <- as_bibentry(as_cff(bib))) - expect_snapshot(toBibtex(back)) -}) - -test_that("Fallback month", { - bib <- bibentry("Article", - title = "An Article", - author = "John Doe", - journal = "El Adelantado de Segovia", - year = "1678", - date = "1678-04-23" - ) - - expect_snapshot(toBibtex(bib)) - x <- as_cff(bib) - - # Delete here the month - x$month <- NULL - - bibback <- as_bibentry(x) - expect_snapshot(toBibtex(bibback)) -}) - - -test_that("Test Fallback year", { - x <- cff() - - expect_silent(msg <- as_bibentry(x)) - - expect_snapshot(toBibtex(msg)) - - - x$`date-released` <- "2020-01-01" - - expect_true(cff_validate(x, verbose = FALSE)) - - parsed <- as_bibentry(x) - - expect_snapshot(toBibtex(parsed)) -}) - -test_that("Errors", { - expect_silent(b <- as_bibentry("testthat")) - expect_s3_class(b, "bibentry") - expect_error(as_bibentry("testthat", what = "aa")) -}) - -test_that("From package", { - skip_if_not_installed("rmarkdown") - - base <- as_bibentry("rmarkdown") - - expect_s3_class(base, "bibentry") - - expect_length(base, 1) - - refs <- as_bibentry("rmarkdown", what = "references") - expect_s3_class(refs, "bibentry") - - expect_gte(length(refs), 1) - - all <- as_bibentry("rmarkdown", what = "all") - expect_s3_class(all, "bibentry") - - expect_length(all, length(base) + length(refs)) -}) - -test_that("NULL references", { - basic <- cff() - - expect_identical( - as_bibentry(basic, what = "references"), - bibentry() - ) - - # Test all - expect_silent(l <- as_bibentry(basic, what = "all")) - expect_length(l, 1) -}) - - -test_that("From CITATION.cff", { - p <- system.file("examples/smith-et-al.cff", package = "cffr") - - base <- as_bibentry(p) - - expect_s3_class(base, "bibentry") - - expect_length(base, 1) -}) - -test_that("Corrupt entry", { - bib <- bibentry("Article", - key = "knuth:1984", - author = person("R Core Team"), - title = "Literate Programming", - journal = "The Computer Journal", - year = "1984", - # Optional - volume = "27", - number = 2, - pages = "97--111", - month = "January", - keywords = "Some, simple, keywords" - ) - x <- as_cff(bib)[[1]] - x$year <- NULL - x$journal <- NULL - expect_snapshot(n <- as_bibentry(x)) - expect_identical(bibentry(), bibentry()) -}) diff --git a/data-raw/test2-as_cff_reference.R b/data-raw/test2-as_cff_reference.R deleted file mode 100644 index 420ff44b..00000000 --- a/data-raw/test2-as_cff_reference.R +++ /dev/null @@ -1,235 +0,0 @@ -# Underlying tests in as_bibentry -# Corner cases here - -test_that("citations with installed packages", { - installed <- as.character(installed.packages()[, 1]) - inst <- c("base", "jsonlite", "rmarkdown") - for (i in seq_len(length(inst))) { - if (inst[i] %in% installed) { - desc <- cff_create(inst[i]) - expect_true(length(desc$`preferred-citation`) > 1) - expect_true(cff_validate(desc, verbose = FALSE)) - } - } -}) - -test_that("Test full with CITATION and (option = author)", { - # Needs an installed package - desc_path <- system.file("examples/DESCRIPTION_rgeos", package = "cffr") - cit_path <- system.file("examples/CITATION_auto", package = "cffr") - parsed <- cff_safe_read_citation(desc_path, cit_path) - expect_s3_class(parsed, "cff") - - # Create cff - cffobj <- cff_create(desc_path, keys = list( - references = parsed - )) - - expect_s3_class(cffobj, "cff") - expect_snapshot(cffobj) - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - - -test_that("Parsed several citations", { - # Needs an installed package - desc_path <- system.file("examples/DESCRIPTION_rgeos", package = "cffr") - cit_path <- system.file("examples/CITATION_auto", package = "cffr") - citobj <- cff_safe_read_citation(desc_path, cit_path) - expect_s3_class(citobj, c("cff_ref_lst", "cff"), exact = TRUE) - - expect_snapshot(citobj) - expect_length(citobj, 3) -}) - - -test_that("Add wrong field to citation", { - bib <- bibentry( - bibtype = "Manual", - title = "favoritefood is not valid on cff schema", - author = "Jane Smith", - favoritefood = "bananas", - type = "I should be removed" - ) - - bibparsed <- as_cff(bib) - - expect_s3_class(bibparsed, "cff") - - cffobj <- cff_create(cff(), - keys = list( - references = bibparsed - ) - ) - - expect_snapshot(cffobj) - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Fix wrong orcid", { - bib <- bibentry( - bibtype = "Manual", - title = "Wrong orcid fixed by cffr", - author = person("Jane", - "Smith", - comment = c( - ORCID = - "http://orcid.org/0000-0000-0000-306X" - ) - ) - ) - - bibparsed <- as_cff(bib) - - expect_s3_class(bibparsed, "cff") - - cffobj <- cff_create(cff(), - keys = list(references = bibparsed) - ) - - expect_snapshot(cffobj) - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Several identifiers and duplicates", { - bib <- bibentry( - bibtype = "Manual", - title = "A Language and Environment for Statistical Computing", - year = "2022", - year = "2023", - author = person("R Core Team"), - version = NULL, - error = "", - url = "https://www.R-project.org/", - url = "https://google.com/", - doi = "10.5281/zenodo.5366600", - doi = "10.5281/zenodo.5366601", - doi = "10.5281/zenodo.5366602", - identifiers = "a,b" - ) - - bibparsed <- as_cff(bib) - - expect_s3_class(bibparsed, "cff") - - cffobj <- cff_create(cff(), - keys = list( - references = bibparsed - ) - ) - - expect_snapshot(cffobj) - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Test keywords and urls", { - bib <- bibentry( - bibtype = "Manual", - title = "A Language and Environment for Statistical Computing", - year = "2022", - author = person("R Core Team"), - url = "https://www.R-project.org/", - url = "https://google.com/", - keywords = "Some, random keywords, in, here, here" - ) - - bibparsed <- as_cff(bib) - - expect_s3_class(bibparsed, "cff") - - cffobj <- cff_create(cff(), - keys = list( - references = bibparsed - ) - ) - - expect_snapshot(cffobj) - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Coerce persons on CITATION", { - bib <- bibentry("Manual", - title = "A Language and Environment for Statistical Computing", - year = "2021", - author = person("R Core Team"), - contact = "A name and A contact", - conference = person("A", "conference"), - "database-provider" = person("Database", "provider"), - editors = "A editor and {Ben and Jerry}", - "editors-series" = "An {editor series} and Another", - "institution" = person("A", "institution"), - "address" = person("A", "location"), - "publisher" = person("A", "publisher"), - "recipients" = "A recipient", - "senders" = "{A Sender} and Another Sender", - "translators" = "Translator one and Translator two" - ) - - bibparsed <- as_cff(bib) - expect_snapshot(bibparsed) - - cffobj <- cff_create(cff(), - keys = list(references = bibparsed) - ) - - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Test inputs", { - # Remove type - - bib <- bibentry("Book", - title = "Test", - author = "Billy Jean", - year = "2021", - publisher = "Random House", - type = "RANDOM" - ) - - - bibparsed <- as_cff(bib) - expect_snapshot(bibparsed) - - cffobj <- cff_create(cff(), - keys = list(references = bibparsed) - ) - - expect_true(cff_validate(cffobj, verbose = FALSE)) -}) - -test_that("Fallback date", { - bib <- bibentry("Misc", - title = "Test", - author = "Billy Jean", - date = "2050-01-12", - urldate = "2099-02-02", - publisher = "Random House", - type = "RANDOM" - ) - - init_cff <- as_cff(bib) - - expect_snapshot(init_cff) -}) - -test_that("Duplicates", { - bib <- bibentry("Misc", - title = "Test", - author = "Billy Jean", - date = "2050-01-12", - urldate = "2099-02-02", - publisher = "Random House", - type = "RANDOM" - ) - bib2 <- bibentry("Manual", - title = "Test", - author = "Billy Jean", - date = "2050-01-12", - urldate = "2099-02-02", - publisher = "Random House", - type = "RANDOM" - ) - bibend <- c(rep(bib, 3), bib2) - expect_snapshot(uniq <- as_cff(bibend)) - expect_length(uniq, 2) -}) diff --git a/data/cran_to_spdx.rda b/data/cran_to_spdx.rda index b14d9593..b7d94083 100644 Binary files a/data/cran_to_spdx.rda and b/data/cran_to_spdx.rda differ diff --git a/inst/WORDLIST b/inst/WORDLIST index 20b05b3f..1db8f9d4 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -35,6 +35,7 @@ Lifecycle Markey Mayes Maëlle +NOTEs Niemeyer ORCID Oren diff --git a/inst/schemaorg.json b/inst/schemaorg.json index 419efa85..7fee2569 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -27,5 +27,5 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.3.3 (2024-02-29)", - "version": "1.0.0.9000" + "version": "1.0.1" } diff --git a/man/cff_class.Rd b/man/cff_class.Rd index 72aa6203..685ec505 100644 --- a/man/cff_class.Rd +++ b/man/cff_class.Rd @@ -161,7 +161,7 @@ ref_list #> given-names: Zhian N. #> year: '2023' #> notes: R package version 2.3.8 -#> url: https://github.com/vubiostat/r-yaml/ +#> url: https://CRAN.R-project.org/package=yaml class(ref_list) #> [1] "cff_ref_lst" "cff" @@ -335,7 +335,7 @@ toBibtex(cit) #> author = \{Shawn P Garbett and Jeremy Stephens and Kirill Simonov and Yihui Xie and Zhuoer Dong and Hadley Wickham and Jeffrey Horner and \{reikoch\} and Will Beasley and Brendan O'Connor and Gregory R. Warnes and Michael Quinn and Zhian N. Kamvar\}, #> year = \{2023\}, #> note = \{R package version 2.3.8\}, -#> url = \{https://github.com/vubiostat/r-yaml/\}, +#> url = \{https://CRAN.R-project.org/package=yaml\}, #> \} # cff_pers, cff_pers_lst diff --git a/revdep/README.md b/revdep/README.md index 93aee4f4..029c0769 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,32 +1,33 @@ # Platform -|field |value | -|:--------|:------------------------------------------------------| -|version |R version 4.3.3 (2024-02-29) | -|os |Ubuntu 22.04.4 LTS | -|system |x86_64, linux-gnu | -|ui |X11 | -|language |(EN) | -|collate |C.UTF-8 | -|ctype |C.UTF-8 | -|tz |UTC | -|date |2024-03-24 | -|pandoc |3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/pandoc | +|field |value | +|:--------|:---------------------------------------| +|version |R version 4.3.3 (2024-02-29) | +|os |Ubuntu 20.04.6 LTS | +|system |x86_64, linux-gnu | +|ui |RStudio | +|language |(EN) | +|collate |C.UTF-8 | +|ctype |C.UTF-8 | +|tz |UTC | +|date |2024-04-09 | +|rstudio |2023.12.1+402.pro1 Ocean Storm (server) | +|pandoc |NA | # Dependencies -|package |old |new |Δ | -|:------------|:------|:----------|:--| -|cffr |1.0.0 |1.0.0.9000 |* | -|cli |3.6.2 |3.6.2 | | -|curl |5.2.1 |5.2.1 | | -|desc |1.4.3 |1.4.3 | | -|jsonlite |1.8.8 |1.8.8 | | -|jsonvalidate |1.3.2 |1.3.2 | | -|R6 |2.5.1 |2.5.1 | | -|Rcpp |1.0.12 |1.0.12 | | -|V8 |4.4.2 |4.4.2 | | -|yaml |2.3.8 |2.3.8 | | +|package |old |new |Δ | +|:------------|:------|:------|:--| +|cffr |1.0.0 |1.0.1 |* | +|cli |3.6.2 |3.6.2 | | +|curl |5.2.1 |5.2.1 | | +|desc |1.4.3 |1.4.3 | | +|jsonlite |1.8.8 |1.8.8 | | +|jsonvalidate |1.3.2 |1.3.2 | | +|R6 |2.5.1 |2.5.1 | | +|Rcpp |1.0.12 |1.0.12 | | +|V8 |4.4.2 |4.4.2 | | +|yaml |2.3.8 |2.3.8 | | # Revdeps