Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adding custom rule for Rubocop in the 2 month of employment

Adding custom rule for Rubocop in the 2 month of employment

RubyKaigi2023のLTでお話しました.

Yla Aioi

May 11, 2023
Tweet

More Decks by Yla Aioi

Other Decks in Programming

Transcript

  1. RubyKaigi2022で転職をキメて
    RuboCopのルールを書いた話
    Yla Aioi (@Little_Rubyist)
    Adding custom rule for Rubocop in the 2
    month of employment

    View Slide

  2. 今回話す人/Speaker
    相生ゆら/Yla Aioi
    @Little_Rubyist @Little-Rubyist
    I am interested in RBS and Rubocop.
    2023/02~

    View Slide

  3. 今回話す人/Speaker
    相生ゆら/Yla Aioi
    @Little_Rubyist @Little-Rubyist
    I am interested in RBS and Rubocop.
    2023/02~
    talk about today

    View Slide

  4. When was your first RubyKaigi?
    Job change

    View Slide

  5. Last year was my first time there!
    (That was a lot of fun.)
    Job change

    View Slide

  6. btw, we had a RubyMusicMixin by
    Pixiv last year.
    It will be on the day3 again.
    Job change

    View Slide

  7. I was drunk at the time and said to a
    Rubyist I had just met...
    Job change

    View Slide

  8. “I've been wanting to work at
    BOOKWALKER for 6 months~ >_<”
    Job change

    View Slide

  9. The Rubyist
    Job change

    View Slide

  10. smoothly
    Job change

    View Slide

  11. handed me a
    BOOKWALKER business card.
    Job change

    View Slide

  12. The Rubyist is an employee of the
    company I wanted to join!
    Job change

    View Slide

  13. me when I receive twitter DM right after RubyKaigi

    View Slide

  14. casual interview
    →apply for the job opening
    →joined the company
    Job change

    View Slide

  15. While it is often said that speaking
    about your dreams to others can
    make them come true,
    I did NOT anticipate such a rapid
    pace of events
    Job change

    View Slide

  16. unexpected things like this tend to
    happen at RubyKaigi
    Job change

    View Slide

  17. So, I successfully got into the
    company I wanted to join 🎉
    Job change

    View Slide

  18. Thank you RubyKaigi
    Thank you RubyMusicMixin

    View Slide

  19. It appears to end here,
    but there's a bit more to come

    View Slide

  20. Since I've made the effort to join the
    company, I want to deliver results
    About RuboCop

    View Slide

  21. What I can do even if I don't
    understand the project well enough.
    About RuboCop

    View Slide

  22. A little refactoring
    (so I’m a “little” Rubyist)
    About RuboCop

    View Slide

  23. For example, replacing the short
    one-line `let` with `{...}`
    About RuboCop

    View Slide

  24. About RuboCop

    View Slide

  25. About RuboCop
    An array of `let` defined in rubocop-rspec

    View Slide

  26. About RuboCop
    Converting a long one-line `let` to `do...end`

    View Slide

  27. About RuboCop
    Short one-line `let` is replaced with `{...}`

    View Slide

  28. About RuboCop

    View Slide

  29. About RuboCop
    AST matcher

    View Slide

  30. About RuboCop
    Converting a long one-line `let` to `do...end`

    View Slide

  31. About RuboCop
    Short one-line `let` is replaced with `{...}`

    View Slide

  32. It became a “little” more convenient

    View Slide

  33. Simple Cops like this are easier to
    work on

    View Slide

  34. We can write them even without
    fully understanding the project's
    content, which is a great advantage

    View Slide

  35. There are probably many people
    in this venue who are new to Ruby or
    recent graduates.

    View Slide

  36. Let's try improving the environment
    starting with the easy stuff 👍

    View Slide

  37. Ruby community is SO good! :)
    Summary

    View Slide

  38. I am happy to have Ruby as my first
    programming language

    View Slide

  39. I love Rubyists
    and
    Ruby community

    View Slide

  40. Happy coding with
    Ruby and community!

    View Slide