Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

News file formatting #73

Open
lshep opened this issue May 8, 2020 · 6 comments
Open

News file formatting #73

lshep opened this issue May 8, 2020 · 6 comments
Labels
Intermediate Intermediate level Hackathon project

Comments

@lshep
Copy link
Contributor

lshep commented May 8, 2020

News file formatting check doesn't seem to always pick up on poorly-formatted news file.

@lshep lshep added Intermediate Intermediate level Hackathon project Hackathon labels May 8, 2020
@HenrikBengtsson
Copy link

If useful, here's a validation of traditional NEWS files that I discovered some years ago. If it passes without "bad" entries, then R will render the content, e.g. news(package = "future"). If there's a single "bad" entry, then the NEWS is displayed as-is.

news_check <- function(pathname = "NEWS", verbose = FALSE) {
  db <- tools:::.news_reader_default(pathname)
  bad <- which(attr(db, "bad"))
  if (length(bad) == 0L) {
    if (verbose) message(sprintf("All %s NEWS entries OK", nrow(db)))
    return(invisible())
  }
  db[bad,]
}

@lshep
Copy link
Contributor Author

lshep commented May 9, 2020

We already have that implemented or tried to but it still doesn't seem to pick it up all the time

suppressWarnings({

@lcolladotor
Copy link
Contributor

There's also NEWS.md files (I use them now in most of my packages), just something to keep in mind for these checks.

As for the format, maybe as part of this, there could be a companion issue at https://github.com/Bioconductor/bioconductor.org on explaining a bit more or showing more examples of the valid format(s).

@HenrikBengtsson
Copy link

Agree NEWS.md could/should be validated too. But, just an FYI, support for NEWS.md is still limited in R, e.g. it does not produce a 'Package NEWS' entry the HTML package page (help.start()). It also causes news() to produce an error if you don't have {commonmark} and {xml2} installed;

> news(package="purrr")
Error in loadNamespace(name) : there is no package called 'commonmark'

@lshep
Copy link
Contributor Author

lshep commented May 15, 2020

If you look at the code chunk I referenced it takes into account md files.

@lshep lshep removed the Hackathon label Jun 2, 2020
@lshep
Copy link
Contributor Author

lshep commented Sep 17, 2020

Besides move to BiocCheckGitClone -- more complicated -- a poorly formatted NEWS file won't actually fail or cause an ERROR when being run -- need to figure out how to check syntax of output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Intermediate Intermediate level Hackathon project
Projects
None yet
Development

No branches or pull requests

3 participants