-
Notifications
You must be signed in to change notification settings - Fork 11
Use static analysis to find bugs in our R code before production #3
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
Comments
lintr mainly does style linting at the moment. It runs some of the checks in codetools and also generates errors if there are syntax errors, but both of these types of checks are already run from The default code style used by lintr (Hadley's style guide is also different than the Bioconductor style. This could be customized but it has not been done yet. On top of that there are widely different styles used in Bioconductor packages currently, and no style is being enforced for current or new packages. That being said, there are some trivial cases we could add to lintr that I see commonly when reviewing packages.
# bad
for (i in seq_len(10)) {
x <- c(x, i)
}
# good
x <- integer(10)
for (i in seq_len(10)) {
x[i] <- i
}
I have a open issue at r-lib/lintr#48 for some of these, just haven't had the time to work on them. |
After a quick discussion with Jim, I just want to highlight that I meant analyzing BBS itself (rather than packages built by BBS). Of course, a majority of the code is written in shell scripts (already addressed by issue #2). This issue is just meant to offer a pathway for us to measure current code quality and then improve on it. Implementation ideas are very much welcome! :) |
Currently this isn't possible ( |
Similar to #2, I'd like to see the introduction of static analysis to BBS. Perhaps we could use @jimhester 's lintr . Presumably, lintr will point out many code blocks as in need of improvement. Surely there will be some lintr results that are controversial, but perhaps those code blocks can be brought up for discussion among the Bioconductor core team to identify the canonical approach to solve some problem.
The text was updated successfully, but these errors were encountered: