-
Notifications
You must be signed in to change notification settings - Fork 27
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
Recommend styler over formatR suggestion #57
Comments
Ahh, I see that https://github.com/Bioconductor/bioconductor.org exists! |
Would gladly accept pull requests! |
Bioconductor/Contributions#1451 (comment) Proof -- this package very much liked it |
Awesome! Thanks for letting me know Lori =) I've been working on the getting GitHub Actions up and running for bioc packages at r-lib/actions#84 and this is my current status of Once I'm done with that, I'll get back to this ^_^ |
my own feeling is that one gets 90% of the way there by implementing any commonly accepted style, without having to re-invent the wheel or quibble about details. Of course my own 'priority' is 4 versus two space indentation, and I'd be happy with a recommendation (on bioconductor.rog / BiocCheck; does it require a
|
Created both an introductory and a developer's notes vignette, updated README and docs with examples, added a second biocViews term, fixed some small bugs/typos. Related links (as many as I could remember): * https://rstd.io/tidytools19 * https://twitter.com/CVWickham * https://twitter.com/hadleywickham * https://www.rstudio.com/products/rstudio/download * https://comunidadbioinfo.github.io/post/building-tidy-tools-cdsb-runconf-2019/#.XrbLMxNKiu4 * http://bioconductor.org/ * https://lcolladotor.github.io/pkgs/ * https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html * https://www.bioconductor.org/help/docker/ * https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016532.html * https://github.com/features/actions * https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html * r-lib/actions#84 * r-lib/usethis#1108 * r-lib/styler#636 * Bioconductor/BiocCheck#57 * Bioconductor/bioconductor.org#54 * http://bioconductor.org/developers/how-to/coding-style/ * https://style.tidyverse.org/ * https://twitter.com/lorenzwalthert * https://twitter.com/mt_morgan * https://docs.travis-ci.com/user/languages/r/ * r-lib/pkgdown#1206 * r-lib/pkgdown#1230 * https://twitter.com/jimhester_ * https://www.jimhester.com/talk/2020-rsc-github-actions/ * https://github.com/Bioconductor/BBS * https://github.com/Bioconductor/packagebuilder * https://www.appveyor.com/ * r-hub/rhub#52 * r-hub/rhub#38 * https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/ * https://github.com/r-lib/actions/tree/master/examples * https://yihui.org/en/2018/03/second-pull-request/ * https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml * https://help.github.com/en/actions * https://ropenscilabs.github.io/actions_sandbox/ * https://twitter.com/seandavis12 * https://github.com/seandavi/BiocActions/blob/master/.github/workflows/main.yml * https://twitter.com/CSoneson * https://github.com/csoneson/dreval/blob/master/.github/workflows/R-CMD-check.yaml * https://bioc-community.herokuapp.com/ * https://github.com/leekgroup/derfinderPlot/blob/master/.github/workflows/check-bioc.yml * https://github.com/LieberInstitute/recount3/blob/master/.github/workflows/check-bioc.yml * https://github.com/hpages * r-lib/actions#68 * r-lib/actions#85 * https://twitter.com/opencpu * https://community.rstudio.com/u/const-ae * https://community.rstudio.com/t/compiler-support-fo-c-14-features-on-windows/57284/4 * r-lib/xml2#296 * r-lib/xml2#302 * https://github.com/r-lib/usethis/blob/master/.github/workflows/R-CMD-check.yaml * https://github.com/r-lib/usethis/commits/master/.github/workflows/R-CMD-check.yaml * https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016703.html * https://stat.ethz.ch/pipermail/bioc-devel/2020-April/thread.html * r-lib/remotes#296 * r-lib/actions#86 * r-lib/covr#427 * https://github.com/r-lib/actions/blob/master/examples/pr-commands.yaml * https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04 * r-lib/actions#50 * actions/checkout#238 * https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/Dockerfile_rstudio_4.0.0-ubuntu18.04 * https://twitter.com/niteshturaga * https://twitter.com/cboettig * rocker-org/rocker-versioned#208 * https://github.community/t5/GitHub-Actions/bd-p/actions * https://www.r-consortium.org/blog/2020/03/18/cdsb-diversity-and-outreach-hotspot-in-mexico * https://github.com/maxheld83 * r-lib/actions#87 * https://github.com/yutannihilation
Hi, As I described at r-lib/styler#636 (comment), I made a new R package called ## Automatically re-style the code in your package to a Bioconductor-friendly
## format
## Note that you can pair this function with the RStudio "Reformat code"
## button on the magic wand drop down menu. The keyboard shortcut is
## macOS: shift + command + A
## Windows: shift + control + A
styler::style_pkg(transformers = biocthis::bioc_style())
styler::style_dir(here::here("dev"), transformers = biocthis::bioc_style())
styler::style_dir(
here::here("vignettes"),
transformers = biocthis::bioc_style(),
filetype = "Rmd"
)
styler::style_file(here::here("README.Rmd"), transformers = biocthis::bioc_style())
For the PR, would it be ok to mention both? If so, I'll send the PR soon here and then the one for Bioconductor/bioconductor.org#54 (comment). Best, |
I like the idea of biocthis, but think that it is outside the scope of this hackathon. Also I think it is not suitable as a pull request for BiocCheck, because it adds functionality (correcting problems) beyond the purpose of the package. In the process it introduces significant additional dependencies for relatively specialized function. FWIW this pull request might find a better home in something like biocthis, which could have dependencies on packages (like projroot, ...), etc, that are not relevant to the main purpose of the package (BiocStyle). How about developing biocthis as a separate collaborative project, maybe seeded with discussion on the slack developer forum? I could imagine the dependency analysis and build / check badge generation functions finding a home there, too. |
Hi, ClarificationsI think that we might have had some misunderstandings. The PR I'm proposing for
So this and Bioconductor/bioconductor.org#54 are really about documentation changes. It might be best if I just send the PR to get this process started. I initiated this issue before the upcoming hackathon was announced, but I could wait until then if you prefer that option.
|
Absolutely then updating BiocCheck to advocate for a specific tool for reformatting is in scope. I think there is value in continuing to think of this (this issue) as part of the hackathon. At the least I think it would be valuable to provide other community members to hear / discuss this if desired... |
Ok! I'll wait for the remote hackathon next week then =) I like the idea of getting community feedback. |
In response to the 2020-05-18 BiocCheck-a-thon intro session: Count me in for resolving this issue (can you assign me to it? I can't self-assign). If anyone else is interested, please let me know. Thanks! |
This commit resolves #57 by updating the `handleMessage()` calls after the formatting check fails. Instead of mentioning `formatR`, these messages now refer to: * `styler`, * `biocthis`, * the `BiocCheck` vignette. Furthermore, the `BiocCheck` vignette section on formatting still mentions `formatR`, but it now also mentions in more detail: * `styler`: how to install and run it * `biocthis`: as a companion to `styler` with code how to run it (but not install it since it's optional and the install instructions will hopefully change soon once this package is submitted/reviewed). * a quick overview of the differences between `formatR` and `styler`, though this is mostly done by highlighting current limitations of `formatR`. * how RStudio Desktop's `Reformat code` button (under the magic wand) can help break long lines which is something that `styler` cannot do as discussed in more detail at r-lib/styler#247. `formatR` can do this, but personally, the fact that it broke valid R code in some of my packages made me trust its output less. The NEWS and DESCRIPTION files have been updated accordingly. Former-commit-id: 5604071
Hi,
Based on my recent work for r-lib/actions#84 and at https://github.com/leekgroup/derfinderPlot/blob/master/dev/02_update.R, I want to make a small PR to
BiocCheck
and http://www.bioconductor.org/developers/how-to/coding-style/. This is directly related to r-lib/styler#636.While
formatR
has been really helpful, in my experience when I use it, I need to double check very carefully all the code as it might change the meaning of some of it. My understanding is thatstyler
is the package that is best maintained now for styling code (you still need to check your code! butstyler
seems to do a better job) and I quickly stumbled upon it yesterday on a Google search. UnlikeformatR
, it's compatible with tidyverse code (magrittr
pipes and multi-line piped code), it also updates the example code inroxygen2
-formatted examples. For myderfinderPlot
package (a small one I was testing things with), it didn't break any code unlikeformatR
(see r-lib/styler#636 for the quotes issue).styler
has astyler::tidyverse_style()
function and at r-lib/styler#636 I'm suggesting creating astyler::bioc_style()
orstyler::bioc_like_style()
function that builds upon theirstyler::tidyverse_function()
. Even without such a function, you can currently usestyler
like I did so at https://github.com/leekgroup/derfinderPlot/blob/master/dev/02_update.R#L2-L12 when updating myderfinderPlot
package. Hopefully they like the idea, at which point, I would make a PR instyler
. Probablystyler::bioc_like_style()
is the better name since I wouldn't want the function to enforce things like camelCase,somefunc(a=1, b=2)
oversomefunc(a = 1, b = 2)
, but well, those aren't really checked byBiocCheck
anyway.Both
styler
andformatR
have issues with line lengths as noted in r-lib/styler#247, but from what I read there, it's a very complicated problem.For
BiocCheck
, if you like the idea, I'm suggesting making a PR that either recommendsstyler
first andformatR
second, or only recommendsstyler
(given thatstyler
seems to me more actively maintained). I would also like to make the same suggestion for http://www.bioconductor.org/developers/how-to/coding-style/ though I don't know if there's a GitHub repo for the Bioc website.Best,
Leo
The text was updated successfully, but these errors were encountered: