Slide 1

Slide 1 text

Kaigi Effect June 13, 2024 in RubyKaigi 2024 KaigiEffect発表会 @ydah Yudai TAKADA

Slide 2

Slide 2 text

✦ Yudai TAKADA ✦ GitHub: @ydah / X: @ydah_ ✦ Software Engineer at ANDPAD, Inc. ✦ Co-Founder of Kyobashi.rb ✦ Cheif Organizer of Osaka RubyKaigi 04 ✦ RuboCop RSpec team ✦ Committer of Lrama / committee About me

Slide 3

Slide 3 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan TODAY’s TALK

Slide 4

Slide 4 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan What I did?

Slide 5

Slide 5 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 1.

Slide 6

Slide 6 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan committee v5.3.0 has been released

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 2.

Slide 9

Slide 9 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan RuboCop 🤝 LSP

Slide 10

Slide 10 text

Autocorrect with “Format on save” Very annoying if the code being edited is rewritten RSpec `fit` always autocorrected to `it`… Excessive Autocorrect in LSP

Slide 11

Slide 11 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Support `AutoCorrect: contextual` option for LSP

Slide 12

Slide 12 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan If you do not want "Format on Save" to be autocorrected, add `AutoCorrect: contextual`.

Slide 13

Slide 13 text

RuboCop RSpec v2.31.0 RuboCop factory_bot v2.26.0 RuboCop RSpecRails v2.29.0 ※ RuboCop Capybara did not have the corresponding cop, so it is not supported. Support version

Slide 14

Slide 14 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 3.

Slide 15

Slide 15 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan rubocop-rspec v3 has come!

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Notable changes

Slide 18

Slide 18 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Extract departments to gem

Slide 19

Slide 19 text

Department of RuboCop RSpec We have several departments: RSpec RSpec/Rails (for rspec-rails) RSpec/FactoryBot (for factory_bot) RSpec/Capybara (for capybara)

Slide 20

Slide 20 text

Destination and Status Department Extract to Status RSpec/Capybara rubocop-capybara Extracted in v2.18.0 RSpec/FactoryBot rubocop- factory_bot Extracted in v2.22.0 RSpec/Rails rubocop-rspec_rails Extracted in v2.28.0

Slide 21

Slide 21 text

Migration guide Install the corresponding gem and add to `.rubocop.yml`. # Gemf i le group :test do gem 'rubocop - rspec' gem 'rubocop - capybara' end require: - rubocop - rspec - rubocop - capybara

Slide 22

Slide 22 text

Migration guide Remove the old department in `.rubocop.yml` RSpec/Capybara: Enabled: false RSpec/FactoryBot: Enabled: false RSpec/Rails: Enabled: false

Slide 23

Slide 23 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Remove deprecated code

Slide 24

Slide 24 text

`RuboCop::RSpec::Language::NodePattern` Helper methods to detect RSpec DSL used with send and block def send_pattern(string) "(send #rspec? # { string} . . . )" end

Slide 25

Slide 25 text

Helper method was detrimental to readability….. `RuboCop::RSpec::Language::NodePattern` def_node_matcher :rspec_method?, send_pattern('ˌALL.all') # vs def_node_matcher :rspec_method?, '(send #rspec? #ALL.all . . . )'

Slide 26

Slide 26 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Remove deprecated cops

Slide 27

Slide 27 text

Removed cops Cop name Migration to RSpec/FilePath RSpec/SpecFilePathFormat RSpec/SpecFilePathSuffix RSpec/Capybara/FeatureMethods RSpec/Dialect

Slide 28

Slide 28 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan All previously pending cops are now enabled by default

Slide 29

Slide 29 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 4.

Slide 30

Slide 30 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Activities in Lrama

Slide 31

Slide 31 text

Activities in Lrama Improve parameterizing rules Support for Named Reference in callers Add support for adjusting Index to Inline rules Countermeasures against freeze strings in Ruby 3.4 Improvements for Lrama developers Support output of rules not used in reporting functions

Slide 32

Slide 32 text

and… After event

Slide 33

Slide 33 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 5.

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Me

Slide 37

Slide 37 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan 6.

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Cheif Organizer / Designer

Slide 40

Slide 40 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Designer

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Cheif Organizer

Slide 44

Slide 44 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Request to Keynote Speakers

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Registration and proposals are welcome!

Slide 48

Slide 48 text

Conclusion I have to work hard or super hard!!!

Slide 49

Slide 49 text

May 15th - 17th, 2024 NAHA CULTURAL ARTS THEATER NAHArt, Okinawa, Japan Thank you!!