Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    arekbee
    @arekbee
    when I can expect to fix the buidl errors for master branch ? https://travis-ci.org/jimhester/lintr/builds/491369124
    Jim Hester
    @jimhester
    They are now fixed (jimhester/lintr@e65804d)
    Russ Hyde
    @russHyde
    Hi @jimhester . I noticed that lintr is mentioned on this awesome-list for static analysis tools: https://github.com/mre/awesome-static-analysis . It's stated that lintr is proprietary software: "©️ stands for proprietary software. All other tools are Open Source." I questioned the author about this, thinking, since lintr is on an MIT license it was open source, here mre/awesome-static-analysis#234 . Would you be able to comment on that issue, please.
    arekbee
    @arekbee
    hi @jimhester, could you approve me pull-req jimhester/lintr#360 please or I should do something more?
    Russ Hyde
    @russHyde
    Hi all / @jimhester , I'm doing a talk at Edinburgh R users group on lintr and one of my tools. Do you pronounce it "Lint R" or "Linter"? Are there any particular stumbling blocks for beginners when they first use lintr? (Apologies if this is the wrong venue for non-issues)
    Jim Hester
    @jimhester
    I think either pronunciation is fine, I think when I first wrote it I pronounced it more as "linter", but these days I tend to say "lint R", since that is how I now say other packages like "dply-R", "tidy-R", "knit-R" etc.
    I don't really know of any particular stumbling blocks, but if you come up with some let me know!
    Russ Hyde
    @russHyde
    Thanks
    Russ Hyde
    @russHyde
    Looks like it's been a busy day; there's about 20 less issues than yesterday
    Jim Hester
    @jimhester
    CRAN is making me do a lintr release for a regression in R-devel, so I decided I should work on getting the devel version on CRAN
    benoit
    @BenoitLondon
    Hi is there any doc on how to use all new linters? I understand I have to use with_defaults( <list all linters not in defaults>) ?
    Also the new linter space between right parenthesis and curly brace is nice for if () {but not so much for function(){}as Rstudio diagnostics complains for ifs but not for functions
    benoit
    @BenoitLondon
    aka paren_brace_linter
    benoit
    @BenoitLondon
    could it have an option to disable for function definitions?
    also the undesirable function there is
    $ifelse
    [1] "use an if () {} else {} block"
    I do not get the hint how is the suggested alternative vectorized?
    Jim Hester
    @jimhester
    It is not vectorized, but very often people misuse ifelse when they should be using if else
    Jim Hester
    @jimhester
    @russHyde I need to do a lintr release by friday, so if you think there are any outstanding issues that would be useful to address now would be a good time to work on them
    Russ Hyde
    @russHyde
    No problem. The only other thing I'd been working on was a pretty big change with @joaopmatias . There's no way that I can finish that pull request by Friday.
    Jim Hester
    @jimhester
    Ok, sounds good, no big deal if that doesn't make it into this release
    rahulrachh
    @rahulrachh

    Is there a way to get custom output of lintr in R in the cmd ?

    I know there exist a function that will give me the output in XML. I was wondering is it possible to change the output I get in cmd.
    For e.g CMD output gives me:
    path/of/file:row:col:,essage-type:message
    Can this be modified to:
    LINE:row:message-type:message?
    That is what I am asking.
    I am using:
    R - 3.6.3 - 32-bit
    lintr - 2.0.1

    Jim Hester
    @jimhester
    @rahulrachh what lintr returns is an R object, so you can print it in any way you like by writing a custom print method
    rahulrachh
    @rahulrachh
    ok thanks @jimhester that was helpful
    Dragoș Moldovan-Grünfeld
    @dragosmg
    Yossi Farjoun
    @yfarjoun
    hi! is this room active?
    Jim Hester
    @jimhester
    With some definition of active
    Yossi Farjoun
    @yfarjoun
    :-)
    I'm having trouble using the lintr github action. my repo has R code, but isn't really an r package as such. I just want my .R and .Rmd files linted...
    the packages I need, actually need to be built and not downloaded from cran. When I name these packages in the DESCRIPTION file (which I couldn't avoid having), I get errors. if I don't have a DESCRIPTION file, I get errors.
    it also seems that if I removed all "required" packages from the DESCRIPTION file, I get no linting at all (but I need to test that more carefully...)
    what's the recommended github action to use if I just want a bunch of .R files to be linted without building the package first?
    Jim Hester
    @jimhester
    It would be easier to help if you link to your workflow file
    Yossi Farjoun
    @yfarjoun
    I used the one auto-generated by usethis..
    my repo is private.
    on:
      push:
        branches:
          - main
          - master
      pull_request:
        branches:
          - main
          - master
    
    name: lint
    
    jobs:
      lint:
        runs-on: macOS-latest
        env:
          GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
        steps:
          - uses: actions/checkout@v2
    
          - uses: r-lib/actions/setup-r@v1
    
          - name: Query dependencies
            run: |
              install.packages('remotes')
              saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
              writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
            shell: Rscript {0}
    
          - name: Restore R package cache
            uses: actions/cache@v2
            with:
              path: ${{ env.R_LIBS_USER }}
              key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
              restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
    
          - name: Install dependencies
            run: |
              install.packages(c("remotes"))
              remotes::install_deps(dependencies = TRUE)
              remotes::install_cran("lintr")
            shell: Rscript {0}
    
          - name: Install package
            run: R CMD INSTALL .
    
          - name: Lint
            run: lintr::lint_package()
            shell: Rscript {0}
    Jim Hester
    @jimhester
    If what you are trying to lint is not a package, call lintr::lint_dir() instead of lint_package()
    Yossi Farjoun
    @yfarjoun
    ok. sounds good. will that also invoke the linkr-bot?
    also, in that case, it seems that I could significantly reduce the yml....but I'm not sure how...
    Jim Hester
    @jimhester
    it is just a text file in .github/workflows/, just delete the lines you don't need
    Yossi Farjoun
    @yfarjoun
    if I understood the yml, I would!
    I don't understand the Query dependencies and Restore R package cache part....is there some reading I coudl do to understand it?
    Jim Hester
    @jimhester
    It is figuring out what dependencies your package needs and restoring the package cache, if you are not using an R package and installing any dependencies some other way I guess you don't need them
    Yossi Farjoun
    @yfarjoun
    :+1:
    ok...so lint_dir("scripts") completed, and gave a bunch of warnings. but it's difficult to understand which file is the culprit, and there are not comments added by the lintr-bot:
    Run lintr::lint_dir("scripts")
      lintr::lint_dir("scripts")
      shell: /usr/local/bin/Rscript {0}
      env:
        GITHUB_PAT: ***
        R_LIBS_USER: /Users/runner/work/_temp/Library
        TZ: UTC
        _R_CHECK_SYSTEM_CLOCK_: FALSE
        NOT_CRAN: true
    Warning messages:
    Warning: Variable and function name style should be snake_case.
    1: In readLines(filename) :
    Warning: Use <-, not =, for assignment.
      incomplete final line found on '/Users/runner/work/VitaminD_COVID_MR_reproduce/VitaminD_COVID_MR_reproduce/scripts/VD_extract_SNPs_test.R'
    Warning: Put spaces around all infix operators.
    2: In readLines(file) :
    Warning: Variable and function name style should be snake_case.
      incomplete final line found on
    Jim Hester
    @jimhester
    comments are not going to work on a private repository, there is no way for the bot to access it
    Yossi Farjoun
    @yfarjoun
    ah. right.
    makes sense!
    can I give it a TOKEN?
    Jim Hester
    @jimhester
    no