Using lintr and styler to improve the quality and readability of R code (CC300)

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 10

  • @spacelem
    @spacelem หลายเดือนก่อน +1

    Oh dear, lintr really didn't like my main file! It doesn't like having commented out code, indenting by 4 spaces instead of 2 (I prefer wider indents so I can distinguish them better!), where I had tic(); fn(); time_taken

    • @Riffomonas
      @Riffomonas  28 วันที่ผ่านมา +1

      I've seen others get burned by code that was supposed to be commented, but wasn't - and vice versa. I've done it to myself as well even on these videos! For the number of spaces, you can adjust the linter by using something like this in your .lintr file.
      linters: linters_with_defaults(
      indentation_linter(indent = 4L))

  • @ianworthington2324
    @ianworthington2324 หลายเดือนก่อน +1

    Difficult to believe that the size of a punch card remains the recommended line length all these years later.

  • @djangoworldwide7925
    @djangoworldwide7925 หลายเดือนก่อน

    Aay GitHub actions detected a lint issue, does it automatically run styler to fix it? If not, what benefit does it have?

    • @Riffomonas
      @Riffomonas  หลายเดือนก่อน

      It doesn't, but there is a separate GHA for running styler. We'll readdress this in the next episode so you can detect problems before pushing. I think the benefit of this particular GHA is for pull requests from others so that their code can get run through a lintr before trying to pull it into your code

  • @tchamoupotindji
    @tchamoupotindji หลายเดือนก่อน

    Hello, which package or options did you use to check integrity of your code after passing it to styler ? I'm referring to the one you used via the Build button

    • @Riffomonas
      @Riffomonas  หลายเดือนก่อน

      That's my package - phylotypr - that I run Build on. Is that what you're asking about?

    • @tchamoupotindji
      @tchamoupotindji หลายเดือนก่อน

      @@Riffomonas yes, thanks