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 full-size slide

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

    View full-size slide

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

    View full-size slide

  4. When was your first RubyKaigi?
    Job change

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  9. The Rubyist
    Job change

    View full-size slide

  10. smoothly
    Job change

    View full-size slide

  11. handed me a
    BOOKWALKER business card.
    Job change

    View full-size slide

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

    View full-size slide

  13. me when I receive twitter DM right after RubyKaigi

    View full-size slide

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

    View full-size 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  18. Thank you RubyKaigi
    Thank you RubyMusicMixin

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  24. About RuboCop

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  28. About RuboCop

    View full-size slide

  29. About RuboCop
    AST matcher

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  32. It became a “little” more convenient

    View full-size slide

  33. Simple Cops like this are easier to
    work on

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  37. Ruby community is SO good! :)
    Summary

    View full-size slide

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

    View full-size slide

  39. I love Rubyists
    and
    Ruby community

    View full-size slide

  40. Happy coding with
    Ruby and community!

    View full-size slide