Skip to content

Bioconductor style linters #43

Closed
Closed

Description

@jimhester

Activity

  1. mjsteinbaugh commented on Jun 18, 2017

    @mjsteinbaugh

    @jimhester Any update on this? Would love to see this feature added. I'd be happy to help contribute.

  2. added
    feature
    and removed on May 17, 2018
  3. kjohnsen commented on May 22, 2018

    @kjohnsen

    I'd also be interested in this 😃

  4. jimhester commented on May 23, 2018

    @jimhester
    MemberAuthor

    For those interested I would gladly review a PR!

  5. mjsteinbaugh commented on May 23, 2018

    @mjsteinbaugh

    Cool thanks Jim, I'll see if I can put together a list of rules that would be helpful.

  6. kjohnsen commented on May 23, 2018

    @kjohnsen

    I could use this since I'm developing a Bioconductor package now, so I'll see what I can do to help

  7. jimhester commented on May 24, 2018

    @jimhester
    MemberAuthor
  8. llrs commented on Sep 27, 2018

    @llrs

    Maybe a good way to start is using this file I could spend some time, I have also some interest on this: see r-lib/styler#331

    I understand that this is different from r-lib/styler but I don't understand if there is any relationship between these packages or not. Anyway with that file it seems that it might be easier for me to use lintr

  9. mjsteinbaugh commented on Sep 27, 2018

    @mjsteinbaugh

    @llrs I've been using this .lintr file in my packages, which has some additional checks

  10. russHyde commented on Nov 12, 2019

    @russHyde
    Collaborator

    Hi @mjsteinbaugh , would you be OK if I used your .lintr for basejump to define a list of bioconductor defaults within lintr?

  11. mjsteinbaugh commented on Nov 12, 2019

    @mjsteinbaugh

    Sure thing!

  12. russHyde commented on Nov 12, 2019

    @russHyde
    Collaborator

    There's some additional best-practices mentioned here:
    http://bioconductor.org/developers/package-guidelines/#rcode

    • Use vapply() instead of sapply() and use the various apply functions instead of for loops.
    • Use seq_len() or seq_along() instead of 1:...
      -Use TRUE/FALSE instead of T/F
    • Avoid class()== and class()!= instead use is()
    • Use system2() instead of system
    • Do not use set.seed in any internal R code.
    • No browser() calls should be in code
    • Avoid the use of <<-.
    • Avoid use of direct slot access with @ or slot(). Accessor methods should be created and utilized
    • Use <- instead of = for assignment
    • Function names should be camel case or utilize the underscore _ and not have a dot . which indicates S3 dispatch.
    • Use dev.new() to start a graphics drive if necessary. Avoid using x11() or X11() for it can only be called on machines that have access to an X server.
  13. mjsteinbaugh commented on Nov 12, 2019

    @mjsteinbaugh

    Yes, refer to BiocCheck::BiocCheck() for details on additional Bioconductor checks. In particular, I run it on CI with these flags: https://github.com/acidgenomics/Rcheck/blob/master/checks/bioc-check

  14. mjsteinbaugh commented on Nov 12, 2019

    @mjsteinbaugh

    Also, one addition that would be particularly useful in my opinion is improved handling of internal S4 method functions, which currently return as lint errors. Here's an example:
    https://github.com/acidgenomics/basejump/blob/master/R/counts-methods.R#L46

    counts,SummarizedExperiment will currently fail the camelCase lint check. This is similar to the S3 method lint issue reported in #223.

  15. MichaelChirico commented on Apr 5, 2022

    @MichaelChirico
    Collaborator

    Encourage anyone that's interested to file PRs. Would especially be nice to include some for the 3.0.0 release. A lot of the points referenced in #43 (comment) are already doable with existing linters; others would be straightforward adaptations of existing logic (see e.g. the linters filed in #884). We can add the bioconductor tag to allow linters_with_tags("bioconductor") to facilitate easy .lintr configs.

  16. MichaelChirico commented on Nov 14, 2023

    @MichaelChirico
    Collaborator

    Gonna close this issue so it's not just indefinitely open. We remain open to PRs, but none of the current maintainers are too familiar with BioConductor practices. Moving forward interested contributors might consider:

    • Filing individual PRs for supporting linters not yet available in {lintr}. If you know a particular rule you'd like to see, but are intimidated about getting started writing a new linter, please reach out & we are happy to help.
    • File feature requests for extending/parameterizing existing linters to support different styles.
    • File a new master issue listing out specific rules to support. The current issue has too much other discussion -- starting a new, focused issue with tangible end points would be more helpful.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehelp wanted ❤️new-linter

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions