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

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 10

  • @tchamoupotindji
    @tchamoupotindji 3 месяца назад

    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  3 месяца назад

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

    • @tchamoupotindji
      @tchamoupotindji 3 месяца назад

      @@Riffomonas yes, thanks

  • @spacelem
    @spacelem 2 месяца назад +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  2 месяца назад +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 3 месяца назад +1

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

  • @djangoworldwide7925
    @djangoworldwide7925 3 месяца назад

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

    • @Riffomonas
      @Riffomonas  3 месяца назад

      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