
- fix NEWS checking. it does not seem to detect incorrect formatting
  of NEWS files (as detected by biocViews::getPackageNews/printNEWS)
- check that knitr is in suggests if it is being used to build vignettes
  (required)
- check that all packages in Depends/Suggests/Enhances/LinkingTo/Imports
  are actually available? Here's why: suppose pkg being checked 
  Depends on CRAN pkg foo which is installed on our builders
  but is subsequently removed from CRAN. The next time we 
  reinstall R on the builders we won't be able to install pkg
  foo. I'm not sure BiocCheck is the best place for this check...
- if --new-package is turned on, check that pkg name
  (modulo case changes) is not already in bioc
- make sure i am using ifelse properly
- Check to see if case-sensitivity is wrong in biocViews?
X - Check to see if submitter's email address (from maintainer field)
  is subscribed to bioc-devel? This could only run if an option is
  set containing a valid password to access the bioc-devel membership list.
Latest round of feedback (3/7/2014):

  add file/line # for eval=FALSE hits
X  silence .C output
X  either change NOTE to something else or be 
    explicit in pkg output that NOTEs will not turn into
    something more severe.
X  remove ! from formatting NOTEs
  indent more -- maybe everything except
  * ERROR
  * WARNING
  * NOTE
  (and summary)

  should be indented?

  HTML report?

  unit test coverage
  BiocSubmit package (long range)

X - Import latest biocViews package to enforce use of new terms (but only 
after it's available via biocLite())
- DESCRIPTION:Depends should say R ( >= X) where X is current version of R.
- does package exist already (in CRAN?). Enabling this means we
  should add an --offline option to disable any check that requires
  net access. Note that "PACKAGE" and "package" are equivalent on windows, so checking neeeds to be case-insensitive.
  
- organize output into more coherent categories

- detect if we are running on a binary/installed package and
  not a source package?

Should we check for windows line endings?
If Title in DESCRIPTION is short (or one word...), emit NOTE...after all this
will be tweeted....

Xfix install bug if R is not in path
X- check for <<-

More suggestions are going in the wiki:
https://github.com/Bioconductor/BiocCheck/wiki

X-Detect problematic depends: see Martin's email

Suggestions from Nate:
X- Valid license ( R CMD check checks this)
- Make sure every (non-trivial) class has a show() method.
   or at least display the #/% of classes that don't.

---
more ideas from dan:

X- search for browser() statements
X- search for more than one (e.g.) examples section in man page?
  (subsequent ones are not checked by R CMD check)
  (I think R CMD check warns about this)

X - biocViews
X- version number check
X- DESCRIPTION file constraints from build system, e.g., email address in Maintainer
X vignettes/ not inst/doc/
- examples in man page 
   X every man page which documents an exported function
    must have an example (required)
- dontrun / eval=FALSE
    warnings - note percent 
X- unit tests
X- deprecated packages
    multicore
- detect OS-specific code?
X- registration of .Call entry points
    getLoadedDLLs() - is there one?
    getDLLRegisteredRoutines() if it returns nothing
    warning
X- use of .C is a note
- \seealso{} ?
    NOTE: count # of times it's used
- print() cat() message() warning() error() (mis)use?
X- library(pkg) in man pages
    warning
X- code formatting stats / constats
    X indentation, line length NOTE
    formatR / tidy?
- if () '%' vs '%%' # & vs &&, | vs || ?
X- NAMESPACE and DESCRIPTION file consistency
    warning getNamespaceImports
    loadedNamespaces()
    all 
- devtools? codetoolsBioC?
   X NOTE: writeNamespaceExports try/catch
X- NEWS file
    missing?
    well-formatted?
    warning

X- using T and F instead of TRUE/FALSE? (I think R CMD check only checks for this in default param values)
    would be nice - 
    rapply(body)
    codetools
X    - Is version number ok for a new package? (0.99.z). We'd need to know if the package is intended to be a new package.

misc notes

Required - like error, but check continues, BUT it returns an error code,
  nothing propagates 
    biocViews
Recommended - like warning 
Note - neutral

Is error necessary?

X add new flag --new-package,
    then check that version is 0.99.z if that switch is on

tools::Rdindex

yihui -formatR dependency on net connection (css and js files)

make sure we are warn = 1 to report warnings when they happen (a la R CMD check)


how to find occurences of T and F in code:
p <- parse("file.R")
the code
then
df <- getParseData(p)
tfs <- df[which(df$token == "SYMBOL" & df$text %in%  c("T", "F")),]
hasTF <- dim(tfs)[1] > 0

new todos 1/15/14



*** TODO start BiocCheck
**** Required (errors) [1/1]
- [X] biocViews - present - valid - consistent hierarhcy
- [2/3] version number check
   - [X] valid version
   - [X] appropriate for devel or release
   - [X] new packages: 0[-.]99[-.][0-9]+
- [3/3] DESCRIPTION
   - [X] Version: field
   - [X] Maintainer: field
   - [X] email parsed from maintainer field
- [0/2] Vignette
   - [X] vignette directory
   - [X] vignette sources (Rnw, Rmd, Rrst)
- [/] man
   - [X] runnable examples on pages with exported functions / methods
- Cross-platform availability
**** Recommended (warnings)
- [X] NAMESPACE and DESCRIPTION file inconsistency
       all(names(getNamespaceImports("Rsamtools")) %in% loadedNamespaces())
       all(unmangled(packageDescription("Rsamtools")$Imports) %in% 
getNamespaceImports("Rsamtools"))
- [0/1] vignette
   - [..] % eval=FALSE chunks (noted but it's not a warning...)
- [0/1] inst/doc
   - [X] vignette sources (Rnw, Rmd, Rrst)
- [0/1] man
   - [ ] % dontrun
- [0/1] tests
   - [X] non-empty tests/ directory
- [0/2] R/
   - [X] OS-specific packages / code ?
   - [X] Don't use T / F
- [X] NEWS
       - present in ./ or ./inst
       - well-formatted?
- [X] registration of .Call entry points
   - pkg in getLoadedDLLS() but no getDLLRegistredRoutines()
- [X] library(MyPackage) / require() in man pages
- print() cat() message() warning() stop() (mis)use?
**** Other? (note)
- [X] use of .C
- [ ] \seealso{} (times used; more is better)
- [?] Code formatting stats (X) / consistency (?)
- [X] warnings reported to user
- [X] codetoolsBioC::writeNamespaceExports()
- devtools? formatR?
